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

2015-05-16 Thread Ananda Debnath
Sorry, I don't follow. If I have functions that are common to many of *my *custom libraries, I'll need to put them in */usr/lib/python2.6/site-packages/ansible/module_utils/mycommon.py* and then import them in my libraries with *from ansible.module_utils.mycommon import ** right? Are you

[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 Ananda Debnath
modules. On Friday, May 15, 2015 at 10:21:52 AM UTC-5, Brian Coca wrote: stuff in lib/ansible/module_utils/ On Fri, May 15, 2015 at 11:05 AM, Ananda Debnath ananda@gmail.com javascript: wrote: Thanks Brian. Is there a way to add custom common functions? On Friday, May 15

[ansible-project] Re: (Derived) variable resolution bug?

2015-04-02 Thread Ananda Debnath
Known bug: https://github.com/ansible/ansible/issues/10251 and https://github.com/ansible/ansible/issues/10564 -- 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] Re: (Derived) variable resolution bug?

2015-03-12 Thread Ananda Debnath
A friend at work was wondering whether this has to do with the location of the extravars.json file - I moved it out to the base directory of the ansible project and added another var to make sure the extravars.json file was being loaded - with no difference in results.

[ansible-project] (Derived) variable resolution bug?

2015-03-11 Thread Ananda Debnath
*Is this a bug or am I misunderstanding how variables are resolved based on precedence? According to http://docs.ansible.com/playbooks_variables.html, * * extra vars (-e in the command line) always win * then comes connection variables defined in inventory (ansible_ssh_user, etc) * then

Re: [ansible-project] Re: Steps for ssh forwarding?

2015-02-17 Thread Ananda Debnath
to the domain, then I can optionally remove the root keys. This is all done with Ansible. On Saturday, February 14, 2015 at 11:10:11 AM UTC-5, Ananda Debnath wrote: Thanks for looking. There are too many current processes dependent on passwords that I'm migrating to Ansible - while converting

Re: [ansible-project] Re: Steps for ssh forwarding?

2015-02-14 Thread Ananda Debnath
specified in the ssh_config file in order to use sshpass with the password specified in the inventory file? On Saturday, February 14, 2015 at 10:10:11 AM UTC-6, Ananda Debnath wrote: Thanks for looking. There are too many current processes dependent on passwords that I'm migrating

Re: [ansible-project] Re: Steps for ssh forwarding?

2015-02-14 Thread Ananda Debnath
: Not the answer you're looking for, but why don't you just use ssh keys? It's some minor work upfront with huge security and automation benefits easier. On Fri, Feb 13, 2015 at 3:51 PM, Ananda Debnath ananda@gmail.com javascript: wrote: Does anyone know of an example to do

[ansible-project] Re: Steps for ssh forwarding?

2015-02-13 Thread Ananda Debnath
Does anyone know of an example to do this using *password *authentication? My inventory file has ansible_ssh_user and ansible_ssh_pass values set and my ssh config file has password authentication set to yes. *my.ssh.config* Host 56.66.3.10 User king HostName

[ansible-project] Re: Steps for ssh forwarding?

2015-02-02 Thread Ananda Debnath
Many thanks! After a few hours of wresting with this and my setup, and a typo that my eyes kept skimming over I finally got this working. Thanks again for point it out to me Giovanni! -- You received this message because you are subscribed to the Google Groups Ansible Project group. To

[ansible-project] Steps for ssh forwarding?

2015-02-02 Thread Ananda Debnath
Hi Ansiblers, I have an Ansible controller machine that contains my playbooks, custom libraries, key files etc. I have an inventory of host machines and CentOS VM's that run on these host machines. The VMs aren't directly accessible from the Ansible box. To get to each VM manually, I need to

[ansible-project] Re: custom modules how to include custom files

2014-12-11 Thread Ananda Debnath
Apologies if this topic has been hashed to death - but I wanted to follow up to see if there is a simple/clever way to solve this problem. I too am writing custom modules for Xen and there's a lot of boilerplate code common to many such modules that would be better off in a common shared python

[ansible-project] Re: Passing variables from role to role

2014-12-01 Thread Ananda Debnath
*ping* - any advice on passing variables from one role to another? On Tuesday, November 25, 2014 8:58:49 AM UTC-6, Ananda Debnath wrote: Hola, I have a playbook with multiple roles mapped to multiple vms. I'm registering a variable in the output of one of the tasks in role A and need

Re: [ansible-project] Re: Passing variables from role to role

2014-12-01 Thread Ananda Debnath
Thanks James. I understand the recommendation - I'll look into decoupling one of these days. For now though, I have a hard dependency - inventory-vm-A/role-A is generating a signed cloudfront url (using aws creds that exist in vm-A) that needs to be downloaded by inventory-vm-B/role-B without

[ansible-project] Passing variables from role to role

2014-11-25 Thread Ananda Debnath
Hola, I have a playbook with multiple roles mapped to multiple vms. I'm registering a variable in the output of one of the tasks in role A and need to pass it to role B. Calling register or set_facts in the role A tasks file works as expected within role A, but this var doesn't seem to make it

Re: [ansible-project] Re: Nested loops with subelements

2014-11-07 Thread Ananda Debnath
Thanks for looking Michael, I was looking for an intuitive way for expressing nested variables in this use case. In my group vars, I specify 3 ec2 region/ami specs: ec2_specs: - { region: us-east-1, ami: ami-b66ed3de, count: 1, type: t2.micro } - { region: us-west-1, ami: ami-b56e64f0,

[ansible-project] Re: Nested loops with subelements

2014-11-05 Thread Ananda Debnath
Any recommendations? -- 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 this group, send email to

[ansible-project] Nested loops with subelements

2014-11-04 Thread Ananda Debnath
Hi, As others have before me, I find the syntax for nested loops somewhat confusing :( Consider my group_vars: ec2_specs: - { region: us-east-1, ami: ami-b66ed3de, count: 1, type: t2.micro } - { region: us-west-1, ami: ami-b56e64f0, count: 2, type: t2.micro } - { region: sa-east-1, ami:

[ansible-project] Re: Nested loops with subelements

2014-11-04 Thread Ananda Debnath
I guess I could express it as a nested dict in the first place? ec2_specs: - { region: us-east-1, ami: ami-b66ed3de, count: 1, type: t2.micro, containers: [{ name: NGINX_A, hostport: 443 }, { name: NGINX_B, hostport: 444 }] } - etc I suspect though that if I need to express a large number

Re: [ansible-project] Consistent docker_image module failure on ec2 instances

2014-10-31 Thread Ananda Debnath
Any ideas? On Thursday, October 30, 2014 10:17:30 PM UTC-5, Ananda Debnath wrote: Thanks for responding Michael. Here's all the version info: -- You received this message because you are subscribed to the Google Groups Ansible Project group. To unsubscribe from this group and stop

[ansible-project] Consistent docker_image module failure on ec2 instances

2014-10-30 Thread Ananda Debnath
Gurus, I'm trying to create a docker image from a Dockerfile in an ec2 instance. I'm able to create the ec2 instances and copy over the dockerfile fine. However, for *every* ec2 instance I fire up, it *always* fails the first time I try to build the docker image. - name: Build the docker

Re: [ansible-project] ec2_eip is not idempotent

2014-10-30 Thread Ananda Debnath
I agree with Michael on the variable expectations on idempotency here. Is the command 'date' idempotent? It can be invoked with no arguments and almost always *returns* a different value - but results in no *perceivable state change on the system* where the command was called. What about the

[ansible-project] AttributeError: 'module' object has no attribute 'APIError'

2014-10-29 Thread Ananda Debnath
-nginx . Sending build context to Docker daemon 2.56 kB Sending build context to Docker daemon Step 0 : FROM ubuntu:trusty --- 5506de2b643b Step 1 : MAINTAINER Ananda Debnath anandadebn...@micromail.com --- Using cache --- 7a9f0bc9d34f Step 2 : RUN apt-get update