[ansible-project] Re: help on loop over list of dicts

2015-12-10 Thread Mgsz
Thank you Mike for the reply! One of my co-worker helped me out. Basically, I was using nested with_items in two playbook. I have playbook1 running with_items to include playbook2 with tasks which also trying to use with_items, so it failed in the 2nd playbook which the with_items are not

[ansible-project] Re: core.cloud.openstack Error Fetching Image List

2015-12-10 Thread Hugh Ma
This is from the inventory script. Everything is fine until it hits glance to pull the image object. Couldn't construct image object Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/shade/openstackcloud.py", line 254, in _get_client **kwargs) File

[ansible-project] Re: Access ansible list in python script.

2015-12-10 Thread anoop . kolari
Hi Mike, Thank you for your response. I resolved this by following steps. 1. I quoted the arguments passed with the command like python /home/vagrant/setup/configs/update_installed_app.py "*['django-allauth', 'test']*" 2. In python script I can access it as a string. Then using python 'ast'

Re: [ansible-project] variables messed up when using including tasks

2015-12-10 Thread Igor Cicimov
Strange, because I'm sure every time I call a tasks file from another role I have to explicitly include that role's defaults|vars file via vars_files to be able to use its variables. So you are saying you are seeing this happen without this linking. Do you mind showing us the whole main

Re: [ansible-project] variables messed up when using including tasks

2015-12-10 Thread silverdr
> On 2015-12-10, at 23:13, Igor Cicimov wrote: > > Strange, because I'm sure every time I call a tasks file from another role I > have to explicitly include that role's defaults|vars file via vars_files to > be able to use its variables. Actually I stay within

Re: [ansible-project] Raw module and interactive commands

2015-12-10 Thread theyuseus
Is there a tutorial anywhere about how to get started using the expect module? I've installed pexpect but when I try to use it in a playbook it fails with this message: ERROR: expect is not a legal parameter in an Ansible task or handler Based on what I've found (I could only find 2-3

Re: [ansible-project] Raw module and interactive commands

2015-12-10 Thread theyuseus
I've uninstalled and reinstalled version 1.9.4 and it isn't with it. I downloaded it from github and added "library = /path/to/ansible/modules:/path/to/extras" to the ansible.cfg file, had to fix my command to the following text - expect: command: save primary responses:

Re: [ansible-project] Raw module and interactive commands

2015-12-10 Thread Matt Martz
The Ansible expect module will be shipped with 2.0. The current released version is 1.9.4. On Thursday, December 10, 2015, wrote: > On investigation it appears that I do not have the expect module. I > thought I installed ansible with pip install ansible, but I earlier

Re: [ansible-project] variables messed up when using including tasks

2015-12-10 Thread silverdr
> On 2015-12-10, at 23:13, Igor Cicimov wrote: > > Strange, because I'm sure every time I call a tasks file from another role I > have to explicitly include that role's defaults|vars file via vars_files to > be able to use its variables. So you are saying you

Re: [ansible-project] Raw module and interactive commands

2015-12-10 Thread theyuseus
On investigation it appears that I do not have the expect module. I thought I installed ansible with pip install ansible, but I earlier tried homebrew but it didn't work. Maybe something got messed up. I guess I'll try to figure out how to fix my installation. -- You received this message

Re: [ansible-project] variables messed up when using including tasks

2015-12-10 Thread patrycjusz . logiewa
> On 2015-12-09, at 22:35, Igor Cicimov wrote: > > Do you by any chance have some of those vars also defined in the > group_vars/all file? In that case they overide the ones in the roles default > file causing unexpected results for people unaware of this fact.

[ansible-project] core.cloud.openstack Error Fetching Image List

2015-12-10 Thread Hugh Ma
Running into an issue on 2.0 rc2 and latest dev version (2.1) TASK [common : launch a compute instance] ** task path: /home/cluser/automata_ansible/automata_ansible_openstack/openstack/roles/common/tasks/main.yml:2 ESTABLISH LOCAL CONNECTION FOR USER: root

Re: [ansible-project] Raw module and interactive commands

2015-12-10 Thread Brian Coca
It still won't work with the switch as it is a module, which NEEDS to be copied to the target and then executed via python, raw is the only 'module' that does not do this, it is really a special case inside Ansible and not a real module. In 2.0 we are adding the scaffolding to deal with switches,

[ansible-project] Re: Access ansible list in python script.

2015-12-10 Thread Mike Biancaniello
Instead of passing a python list, can you pass a json string? Then, inside the py script, just use json.loads(). -- 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

Re: [ansible-project] variables messed up when using including tasks

2015-12-10 Thread Igor Cicimov
Just out of curiosity, what happens when you supply destination via extra_vars and leave everything as it was in defaults file? On Friday, December 11, 2015 at 11:09:30 AM UTC+11, silverdr wrote: > > > > On 2015-12-10, at 23:13, Igor Cicimov > wrote: > > > >

Re: [ansible-project] variables messed up when using including tasks

2015-12-10 Thread Igor Cicimov
Also if you can put - debug: var=destination before and after every include call would be very helpful to see where the var actually gets changed. Just realized that my previous message might not be clear enough, what I mean is add: --extra-vars '{"destination":"some_value_here"}' to the

Re: [ansible-project] Re: yum_repository module (has anyone thought of doing it...)

2015-12-10 Thread Cha Donghwi
Is this still not implemented to ansible core? 2014년 2월 13일 목요일 오후 10시 22분 54초 UTC+9, Johan Söderberg 님의 말: > > Hi, > > The yum_repository module sounds exactly what I've been looking for. > Unfortunately the url doesn't work and I'm unable to find it anywhere. Is > it still available

[ansible-project] Re: help on loop over list of dicts

2015-12-10 Thread Mike Biancaniello
Not sure what you're doing wrong. Maybe it's the way you define dev_interfaces (yeah, it makes no sense why it would work in debug, but not in with_items, but sometimes that happens). This worked for me: --- - name: stuff connection: local gather_facts: no hosts: localhost vars: