Re: [ansible-project] Copy task w/Content being evaluated as parameters and causing it to fail

2015-05-15 Thread Brian Coca
I would switch to the template module, copy's content is not a good method for anything but trivial file content. -- Brian Coca -- You received this message because you are subscribed to the Google Groups Ansible Project group. To unsubscribe from this group and stop receiving emails from

Re: [ansible-project] Calling a filter_plugin from a custom module

2015-05-15 Thread Brian Coca
stuff in lib/ansible/module_utils/ On Fri, May 15, 2015 at 11:05 AM, Ananda Debnath ananda.debn...@gmail.com wrote: Thanks Brian. Is there a way to add custom common functions? On Friday, May 15, 2015 at 9:52:21 AM UTC-5, Brian Coca wrote: no, filters are not available to modules, but

[ansible-project] Ansible group_vars not loading or am I making a fundamental mistake here?

2015-05-15 Thread Satish Muthali
Hello experts, This is the following ansible directory structure I have: ├── environments │ └── azure_sandbox ├── filter_plugins ├── group_vars │ ├── all.yml

Re: [ansible-project] Can ansible dynamic inventory accept arguments ?

2015-05-15 Thread Bob Brown
Not sure exactly what you mean by accept arguments. You can do something like add the varible into the play book hosts: ' {{ hosts }}' and then when you run the playbook you can say something like ansible-playbook -e hosts=HOSTNAME playbook.yml OR better yet, use the inventory generated

[ansible-project] Calling a filter_plugin from a custom module

2015-05-15 Thread Ananda Debnath
Is there a way to call a filter_plugin from within a custom module? For example, I've written a simple filter_plugin utils.py that contains a 'to_bytes' function. This filter is used from my play like: *debug: msg={{'25GB'|to_bytes}}*. I need to call the same function from within one of my

Re: [ansible-project] Calling a filter_plugin from a custom module

2015-05-15 Thread Ananda Debnath
Thanks Brian. Is there a way to add custom common functions? On Friday, May 15, 2015 at 9:52:21 AM UTC-5, Brian Coca wrote: no, filters are not available to modules, but modules do have a bunch of common functions available, like 'pretty_bytes', probably the reverse of what you want.

Re: [ansible-project] Calling a filter_plugin from a custom module

2015-05-15 Thread Brian Coca
no, filters are not available to modules, but modules do have a bunch of common functions available, like 'pretty_bytes', probably the reverse of what you want. -- Brian Coca -- You received this message because you are subscribed to the Google Groups Ansible Project group. To unsubscribe

Re: [ansible-project] Ansible group_vars not loading or am I making a fundamental mistake here?

2015-05-15 Thread Brian Coca
group/host vars need to be relative to either the inventory or the playbook, you seem to have them in a directory above both, ansible has no reason to look there. You will have the same problem with your 'library' dir which I assume you want to use for custom modules, it must be adjacent to your

[ansible-project] Re: Populating an EC2 Security Group rules (using ec2_group modules) with IPs (Pingdom probe servers) gathered dynamically at playbook runtime

2015-05-15 Thread senorsmile
Has anyone made any further progress on this yet? On Monday, March 23, 2015 at 4:41:24 PM UTC-7, Steven Truong wrote: Thanks for the tips. I tried this and this worked but to only some extents. What do I meant by that and here are the steps that you can repeat to see the potential

[ansible-project] Ansible 1.9.2 rc1 is now available for testing

2015-05-15 Thread James Cammarata
Hi all, we've just tagged the rc1 release for 1.9.2, which includes several fixes for modules (service, rds, among others) as well as some other minor fixes and improvements. To test from source, simply clone the git repository (if you haven't already) and do the following: $ git checkout

Re: [ansible-project] Remove a rule from AWS EC2 Security group using Ansible

2015-05-15 Thread Brent Langston
Create an egress_rules: list that is empty. On May 15, 2015 2:19 PM, Rahul Mehrotra rhlmh...@gmail.com wrote: Thanks Brent that does explain a good detail about how security groups are handled by Ansible. I would still appreciate if you can answer this question. I am creating a security

Re: [ansible-project] Remove a rule from AWS EC2 Security group using Ansible

2015-05-15 Thread Brent Langston
remove the rule from the list. rules: [] Brent On Fri, May 15, 2015 at 1:32 PM, Rahul Mehrotra rhlmh...@gmail.com wrote: I have an Ansible script to create EC2 security group. It looks like this - name: Create HTTP Security Group local_action: module: ec2_group

Re: [ansible-project] Remove a rule from AWS EC2 Security group using Ansible

2015-05-15 Thread Rahul Mehrotra
Thanks Brent that does explain a good detail about how security groups are handled by Ansible. I would still appreciate if you can answer this question. I am creating a security group using - name: Create HTTP Security Group local_action: module: ec2_group region: {{ region }}

Re: [ansible-project] Remove a rule from AWS EC2 Security group using Ansible

2015-05-15 Thread Rahul Mehrotra
Hi, Can you please provide an example. I am specifically interested in removing egress rules allowing everything automatically added by AWS when security groups are created. Thank you

Re: [ansible-project] Calling a filter_plugin from a custom module

2015-05-15 Thread Brian Coca
er .. we do: from ansible.module_utils.basic import * -- You received this message because you are subscribed to the Google Groups Ansible Project group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to

Re: [ansible-project] Calling a filter_plugin from a custom module

2015-05-15 Thread Ananda Debnath
That would be /usr/lib/python2.6/site-packages/ansible/module_utils/ on my system (CentOS 6.6, Ansible 1.9.1) I'm guessing. I know folks have discussed/pleaded this before - but I'd like to add my voice to this as well - having an officially sanctioned way to import common code for custom

[ansible-project] Using tags in a playbook

2015-05-15 Thread Roger Sherman
I'm still pretty new to Ansible, and I'm trying to figure out the proper method for setting up a role, and then calling only a couple of tasks from that role from a playbook. The reason I'm doing so, is I have a group of nodes that need two tomcat instances running on top of a base instance,

[ansible-project] How to play a single role?

2015-05-15 Thread Philip Hallstrom
Using ansible_playback I can use -t to limit the tasks played to the tags I specify. Is there anyway to do that with roles? Something like -r role? Or do I need to tag every task in the role with the name of the role? Thanks! -- You received this message because you are subscribed to the

[ansible-project] Ansible template error: TypeError: unsupported operand type(s) for -: 'StrictUndefined' and 'StrictUndefined'

2015-05-15 Thread Shinta Smith
Hello, I have a task like this: - name: my configuration files template: src={{ item }} dest=/etc/myapp/{{ item }} owner=myuser group=myuser mode=0644 tags: config with_items: - hive-site.xml - my-app.properties When I ran the playbook, I got an error: TASK: [my

Re: [ansible-project] Remove a rule from AWS EC2 Security group using Ansible

2015-05-15 Thread Brent Langston
the security group module will just make your list of rules look like whatever you have currently defined in yml. If you remove a rule from the list, and run the task again, the rule will be removed from the security group at aws. This hold true for both ingress and egress. In other words, for

[ansible-project] Remove a rule from AWS EC2 Security group using Ansible

2015-05-15 Thread Rahul Mehrotra
I have an Ansible script to create EC2 security group. It looks like this - name: Create HTTP Security Group local_action: module: ec2_group region: {{ region }} vpc_id: {{ vpc }} name: sg_http description: Security group for HTTP access rules: - proto: tcp