[ansible-project] Re: Ansible support for pmrun in become_method

2016-06-16 Thread Jonathan Davila
I've made a PR to support pmrun. Right now it is limited to pmrun invocation w/o password prompt. https://github.com/ansible/ansible/pull/16336 On Friday, May 20, 2016 at 5:45:13 AM UTC-7, Taeho Kgil wrote: > > Hi, > > Is there a plan to support pmrun options in the become_method for Ansible? >

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2016-04-05 Thread Jonathan Davila
You can set the python interpreter as a host or group var. Normally I set ansible_python_interpreter: /usr/bin/env python But in your case it sounds like you'd want a specific path. On Friday, April 1, 2016 at 7:18:17 PM UTC-4, Osama Shaikh wrote: > > Hi Brian, > > Has there been any update

Re: [ansible-project] HELP: Problem with 'become' and pbrun

2016-04-05 Thread Jonathan Davila
It looks like your recent run found pbrun. I recently worked with a client that used pbrun and here's a brief walkthrough of what they did to fix it. Also, could you retry via a playbook (not ad hoc) and add - to the run. > > > When you issue a pbrun command such as pbrun /bin/foo/hello

[ansible-project] Re: ec2_vpc always reports configuration has "changed"

2015-11-16 Thread Jonathan Davila
The current ec2_vpc module has issues. We know this and it's on its way out in favor of ec2_vpc_net ec2_vpc_route_table ec2_vpc_subnet which can be found at https://github.com/ansible/ansible-modules-core/tree/devel/cloud/amazon and

[ansible-project] Re: Loop over facts in playbook

2015-11-16 Thread Jonathan Davila
DS, Try this. This simple example will print the device name whenever the device has no partitions - name: Loop facts hosts: localhost connection: local tasks: - name: looping debug: msg: "{{ item.key }}" when: "not {{ item.value.partitions }}" with_dict:

Re: [ansible-project] Re: Manage Unix Users Over Multiple Evironments with Ansible

2015-11-16 Thread Jonathan Davila
Here is a repo with my current favorite role for managing users across different departments and environments: https://github.com/AutoLogicTechnology/autologic-users On Monday, November 16, 2015 at 7:06:06 AM UTC-5, Ralph Bolton wrote: > > Oh my word... I've just cracked it: > > - name: Create

[ansible-project] Re: Openstack - auto_floating_ip

2015-05-08 Thread Jonathan Davila
Hey guys, for now I'd suggest using the modules currently in the pull request queue, the ones made by emonty. https://github.com/ansible/ansible-modules-core/pulls?utf8=%E2%9C%93q=is%3Apr+is%3Aopen+openstack Just download any or all of them into your $PLAYBOOK_ROOT/library directory and you

[ansible-project] Re: Is there a library/framework that enables me to do unit testing to Ansible playbooks?

2015-03-24 Thread Jonathan Davila
To add to Brian's response, here is a link to the documentation where a few strategies are enumerated along with example http://docs.ansible.com/test_strategies.html On Monday, March 23, 2015 at 7:53:50 PM UTC-4, Sean wrote: In Chef's world, there exists ChefSpec, which basically enables

[ansible-project] Re: conditionally running tasks

2015-03-24 Thread Jonathan Davila
You could try to variablize the values of the module parameters into os-specific vars files and then do conditional include statements based on the os. So like --- - hosts: all gather_facts: yes tasks: - include: {{ ansible_distribution }}-{{ ansible_distribution_version }}.yml -

[ansible-project] Re: Loop over facts in playbook

2015-03-24 Thread Jonathan Davila
Hi Edgars, You want to use ansible's with_dict method of looping. Here is an example of looping through that dict and then a sample conditional for it as well # This is the sample with_dict loop - debug: msg=The device {{ item.key }} with these partitions {{ item.value.partitions }}

[ansible-project] Re: On the same server, how to run a role twice with different arguments

2015-03-23 Thread Jonathan Davila
Another method you could use is passing the variable value directly into the role when you call it as such --- - name: SomePlaybook hosts: yourgroup roles: - {role: yourrole, install_path: '/opt/install1' } - {role: yourrole, install_path: '/opt/install2' } On Monday,

[ansible-project] Re: Variable inheritance/override

2015-03-13 Thread Jonathan Davila
Here is a slightly odd technique that you could possibly use. The first step would be to make your 'role/defaults' data structure. In my example it looks like this: car: make: {{ makevar }} model: {{ modelvar }} year: {{ yearvar }} condition: paint: {{ paintvar }} frame: {{

[ansible-project] Re: dict merge - with_dict expects a dict

2015-03-12 Thread Jonathan Davila
so I've got a working sample for you. This is the exact test I did. --- - name: Template Test For Route File connection: local hosts: localhost vars: host_routes: route-oob: device: bond.123 routes: 10.118.0.0/16: '10.118.255.254' route-int:

[ansible-project] Re: dict merge - with_dict expects a dict

2015-03-11 Thread Jonathan Davila
for that with .. - name: Remove 'absent' route files file: path={{ net_path}}/route-{{ item.value.device }} state=absent with_dict: host_routes when: item.value.absent is defined tags: netdev On Wednesday, 11 March 2015 15:23:43 UTC, Jonathan Davila wrote: Would you mind sharing the full body

[ansible-project] Re: dict merge - with_dict expects a dict

2015-03-11 Thread Jonathan Davila
Would you mind sharing the full body of the task that pertains to this as well as the template file? On Tuesday, March 10, 2015 at 12:19:46 PM UTC-4, John McNulty wrote: So the reason why I tried using union was this github issue ( https://github.com/ansible/ansible/issues/7495 ) which

[ansible-project] Re: String to vars not working anymore in Ansible v1.8.x

2015-02-23 Thread Jonathan Davila
Try taking out the middle curly braces. So like: {{ 'prefix_' + item.env + '_postfix' | get_something }} If you are declaring vars with the vars construct, you don't need to reference vars as a dict, the key/values are directly available. Let me know if that helps. On Sunday, February 22,

Re: [ansible-project] [Windows] When executed locally, powershell script works, but over winrm I get errors

2015-01-25 Thread Jonathan Davila
Personally, I've had greater success converting a normal PS script into a proper module. It really isn't too difficult to do and is probably a better way to go in the long term anyways. Have you tried doing that? Or just exclusively executing via the script module? On Saturday, January 24,

[ansible-project] Re: How to use conditions in Playbook itself

2015-01-21 Thread Jonathan Davila
Seems to be sort of an anti-pattern to do it this way. Referencing: https://groups.google.com/forum/#!msg/ansible-project/CPAE8_0YXMg/Az3Etfz7mP8J It sounds like a similar issue at the end. On Wednesday, January 21, 2015 at 11:48:55 AM UTC-5, Suraj wrote: Hi Folks, I am trying to

[ansible-project] Re: Ansible Jumphost + MFA

2014-12-13 Thread Jonathan Davila
Would be cool if you shared the wrapper in a Gist or smth similar! On Friday, December 12, 2014 4:53:51 PM UTC-5, Nico K. wrote: In case someone wonders, I solved this by writing a shell wrapper and using that as 'proxycommand' in my ssh config. The shell wrapper effectively does nothing