[ansible-project] cryptic errors nxos_config

2017-01-20 Thread Eric Marquez
I'm troubleshooting why I keep getting this cryptic errors when I'm attempting to use nxos_config Ansible Version: ansible 2.2.0.0 config file = /home/emarq/Solutions.Network.Automation/MAS/Ansible/cisco/nexus/ansible.cfg configured module search path = Default w/o overrides Ansible.cfg

[ansible-project] Re: Help on ansible tasks

2017-01-20 Thread Shyam Yenna
I have found my defect. Thanks for help and Enjoy coding... -- 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] Help to get the .pem file for Auze

2017-01-20 Thread Amit Saini
Hi, I am working on ansible-playbook for provisioning Azure VMWare and referring the ansible document - name: Provision virtual machine example azure: name: my-virtual-machine role_size: Small image:

Re: [ansible-project] Re: Variable not defined error

2017-01-20 Thread Kai Stian Olstad
On 20. jan. 2017 21:32, Elliott Barrere wrote: My hunch is that you directory structure is not correct so Ansible can't find the files. Yeah, that's what I was thinking too, but unless that changed between versions I don't know why it would suddenly stop working. So this did work at some

Re: [ansible-project] Re: Variable not defined error

2017-01-20 Thread Elliott Barrere
> > My hunch is that you directory structure is not correct so Ansible can't > find the files. > Yeah, that's what I was thinking too, but unless that changed between versions I don't know why it would suddenly stop working. > In the same directory as you inventory file, output of these

[ansible-project] Re: Starting out with Ansible and Vagrant.

2017-01-20 Thread Mischa ter Smitten
Also here's an example of a playbook (using multiple roles) we use for our production wordpress environment: --- - hosts: tiers-production-wordpress roles: - limits - percona-client - percona-server - percona-toolkit - common-schema - innotop - mydumper -

Re: [ansible-project] combining vars facts and other data

2017-01-20 Thread Greg Fitzgerald
This answered my question perfectly. Thank you! On Thu, Jan 19, 2017, at 11:41 PM, Greg Fitzgerald wrote: > Hi, > > I'm coming from chef, and in chef land we do a lot of fancy things in > our attributes files. > > For example in one of my cookbooks I do this. > > node.default['ts3']['arch'] =

Re: [ansible-project] Template Conditionals

2017-01-20 Thread Kai Stian Olstad
On 20. jan. 2017 10:02, Johannes Kastl wrote: On 19.01.17 19:43 Kai Stian Olstad wrote: The foo playbook has templatized config files ... and there's the rub. I want the foo playbook to work on s8 and s9, BUT, I want different strings to be substituted when the template gets processed,

Re: [ansible-project] How does filter of setuo module (facts) run ?

2017-01-20 Thread Kai Stian Olstad
On 20. jan. 2017 09:01, web.c...@orange.fr wrote: I have a poor performance environement and running setup on it get a lot of time. I know i can disable gathering fact with *gather_facts: False* I'm trying this and it's work fine *---* *- hosts: all* * gather_facts: False* * tasks:* *

Re: [ansible-project] Variables from csv and loops with random records

2017-01-20 Thread Kai Stian Olstad
On 20. jan. 2017 09:00, Johannes Kastl wrote: On 19.01.17 11:48 Mátyás Kovács wrote: Hi! Thanks for the advice, I like it. But, I have a syntax error with this: --- - hosts: all tasks: - iptables_raw: The indentation is wrong, the dash should be indented as tasks is: - hosts: all

Re: [ansible-project] Ansible script work with array

2017-01-20 Thread Stepan Harutyunyan
You are right, I tried and this works too, I think this is better solution!!! Thank you one more time On Friday, January 20, 2017 at 7:08:50 PM UTC+4, Stankovic, Marko wrote: > > You're welcome. > I just figured out we were scratching our right ear with left hand. > The same result can be

Re: [ansible-project] combining vars facts and other data

2017-01-20 Thread Kai Stian Olstad
On 20. jan. 2017 05:41, Greg Fitzgerald wrote: Hi, I'm coming from chef, and in chef land we do a lot of fancy things in our attributes files. For example in one of my cookbooks I do this. node.default['ts3']['arch'] = node['kernel']['machine'] =~ /x86_64/ ? "amd64" : "x86" This returns

Re: [ansible-project] Ansible script work with array

2017-01-20 Thread Stankovic, Marko
You're welcome. I just figured out we were scratching our right ear with left hand. The same result can be accomplished by using with_items: "{{ array }}" Then you can access the attributes by item.contactId and item.contactAccount: - set_fact: msg: "{{ item.contactId }}" with_items: "{{

Re: [ansible-project] Ansible script work with array

2017-01-20 Thread Stepan Harutyunyan
Thank you very very much. It works thank you for help. Great Job!!! On Friday, January 20, 2017 at 6:58:12 PM UTC+4, Stankovic, Marko wrote: > > Sorry, I posted the solution without trying it. > It's not int(item), but item | int(). So, this works for me: > msg: "{{ array[item |

Re: [ansible-project] Ansible script work with array

2017-01-20 Thread Stankovic, Marko
Sorry, I posted the solution without trying it. It's not int(item), but item | int(). So, this works for me: msg: "{{ array[item | int()]['contactId'] }}" __ CONFIDENTIALITY NOTICE: This message

Re: [ansible-project] Ansible script work with array

2017-01-20 Thread Stepan Harutyunyan
msg: "{{ array[ [ int(item)] ]['contactId'] }}" Error: fatal: [10.137.25.64]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'int' is undefined\n\nThe error appears to have been in

Re: [ansible-project] Ansible script work with array

2017-01-20 Thread Johannes Kastl
On 20.01.17 15:50 Stepan Harutyunyan wrote: > Again error > > msg: "{{ array[int(item)]['contactId'] }}" I would say that again the brackets are missing: msg: "{{ array[ [ int(item)] ]['contactId'] }}" Johannes -- You received this message because you are subscribed to the Google Groups

Re: [ansible-project] Ansible script work with array

2017-01-20 Thread Stepan Harutyunyan
Again error msg: "{{ array[int(item)]['contactId'] }}" fatal: [10.137.25.64]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'int' is undefined\n\nThe error appears to have been in

Re: [ansible-project] Re: Variable not defined error

2017-01-20 Thread Kai Stian Olstad
On 20. jan. 2017 01:36, Elliott Barrere wrote: Thanks for all the advice, guys (I'm just getting back to this since last month). Unfortunately nothing seems to be working. It appears that none of our variables seem to be getting set. I've tried various different locations and names for the

Re: [ansible-project] Ansible script work with array

2017-01-20 Thread Stankovic, Marko
u'3' means that the value is a string (unicode). Try with: {{ array[int(item)]['contactId'] }} __ CONFIDENTIALITY NOTICE: This message is the property of International Game Technology PLC

Re: [ansible-project] Ansible script work with array

2017-01-20 Thread Stepan Harutyunyan
I put msg: "{{array[ [ item ] ]['contactId'] }}" But again got error: fatal: [10.137.25.64]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: list object has no element [u'3']\n\nThe error appears

Re: [ansible-project] Newlines are escaped when using jinja2 filters in playbook

2017-01-20 Thread Johannes Kastl
On 18.01.17 11:54 Fredrik Rambris wrote: > Is there a way to tell ansible not to escape the newlines in key ? I don't know, I would suggest trying the template module to work around that. Some jinja2-magic with looping through your keylist should work. I also thought there was an escape

Re: [ansible-project] Ansible script work with array

2017-01-20 Thread Johannes Kastl
On 20.01.17 15:01 Stepan Harutyunyan wrote: > Thank you Johannes, > > i put msg: "{{array[item]['contactId']}}" > > but i got following error: > > fatal: [10.137.25.64]: FAILED! => {"failed": true, "msg": "the > field 'args' has an invalid value, which appears to include a > variable that is

Re: [ansible-project] Ansible script work with array

2017-01-20 Thread Stepan Harutyunyan
Thank you Johannes, i put msg: "{{array[item]['contactId']}}" but i got following error: fatal: [10.137.25.64]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'list object' has no attribute

Re: [ansible-project] Ansible script work with array

2017-01-20 Thread Johannes Kastl
On 20.01.17 14:34 Stepan Harutyunyan wrote: > Thank you for your reply, but I can check contactAccount value with my when > condition, I want to take contactId according on contactAccount Sorry, misunderstood your problem. This is wrong syntax, double curly braces are not allowed inside double

Re: [ansible-project] Ansible script work with array

2017-01-20 Thread Stepan Harutyunyan
Thank you for your reply, but I can check contactAccount value with my when condition, I want to take contactId according on contactAccount On Friday, January 20, 2017 at 5:11:38 PM UTC+4, Johannes Kastl wrote: > > On 20.01.17 13:45 Stepan Harutyunyan wrote: > > > when:

Re: [ansible-project] How setup filter of gathering fact work ?

2017-01-20 Thread Johannes Kastl
On 20.01.17 09:07 web.c...@orange.fr wrote: > * tasks:* > *- setup:* > *filter: ansible_eth1 * > > *- debug: var=ansible_eth1.ipv4.address* Maybe gather_subset: "network" can help here, if you just want the ip address. Johannes -- You received this message because you are

Re: [ansible-project] Ansible script work with array

2017-01-20 Thread Johannes Kastl
On 20.01.17 13:45 Stepan Harutyunyan wrote: > when: array.{{item}}.contactAccount == > '**someema...@somedomain.com**'* Maybe the find filter does what you are looking for? array.{{item}}.contactaccount.find('someemail') == 1 Untested! This is not in the filter documentation, I found it in

[ansible-project] Ansible script work with array

2017-01-20 Thread Stepan Harutyunyan
Hi Everyone, Hear is some part of my ansible code, I want to take contactId from Json array when contactAccount is someema...@somedomain.com, but my script's this part "*{{array.{{item}}.contactId}}*" doesn't work. Could anyone help me to solve this problem? *- set_fact: msg:

[ansible-project] How setup filter of gathering fact work ?

2017-01-20 Thread web . cvcc
Hi all I have a poor performance environement and running setup on it get a lot of time. I know i can disable gathering fact with *gather_facts: False* I'm trying this and it's work fine *---* *- hosts: all* * gather_facts: False* * tasks:* *- setup:* *filter:

[ansible-project] Re: apt module behavior

2017-01-20 Thread Igor Schaefer
Спасибо! А где можно изменить этот параметр? Я не нашел его в /etc/ansible/ansible.cfg среда, 18 января 2017 г., 12:06:19 UTC+5 пользователь Alexey Vazhnov написал: > > Ansible set DEBIAN_FRONTEND=noninteractive, so no any dialog. > > On Wednesday, January 18, 2017 at 2:06:34 AM UTC+5, Igor

[ansible-project] How does filter of setuo module (facts) run ?

2017-01-20 Thread web . cvcc
Hi all I have a poor performance environement and running setup on it get a lot of time. I know i can disable gathering fact with *gather_facts: False* I'm trying this and it's work fine *---* *- hosts: all* * gather_facts: False* * tasks:* *- setup:* *filter:

Re: [ansible-project] apt module behavior

2017-01-20 Thread Igor Schaefer
Thank you for paying my attention to the Ansible documentation. I read it but didn't get the dpkg_options среда, 18 января 2017 г., 12:36:28 UTC+5 пользователь Andreas Olsson написал: > > tis 2017-01-17 klockan 01:42 -0800 skrev Igor Schaefer: > > Sure, all you know the situation, when you

[ansible-project] combining vars facts and other data

2017-01-20 Thread Greg Fitzgerald
Hi, I'm coming from chef, and in chef land we do a lot of fancy things in our attributes files. For example in one of my cookbooks I do this. node.default['ts3']['arch'] = node['kernel']['machine'] =~ /x86_64/ ? "amd64" : "x86" This returns either amd64 or x86 based on the architecture of the

[ansible-project] Re: Starting out with Ansible and Vagrant.

2017-01-20 Thread Michael Heap
Good morning Pangaea, Installing Virtualbox is the first step towards working with Ansible and Vagrant. In addition to installing Virtualbox, you'll also need to install Vagrant from http://vagrantup.com/ >From this point onwards, you won't interact with Virtualbox directly at all. Instead,

Re: [ansible-project] Issue with Firewall Role

2017-01-20 Thread Johannes Kastl
Hi there, On 10.01.17 22:50 franklovesespre...@gmail.com wrote: > and I'm trying to get the example below working. The rules in > all.yml are picked up fine, but the rules in webservers.yml are not. If I remember well, I had to delete that file to get it working. I put the stuff from that file

Re: [ansible-project] Template Conditionals

2017-01-20 Thread Johannes Kastl
On 19.01.17 19:43 Kai Stian Olstad wrote: >> The foo playbook has templatized config files ... and there's the >> rub. I want the foo playbook to work on s8 and s9, BUT, I want >> different strings to be substituted when the template gets >> processed, depending on whether I am on s8 or s9. Kai

Re: [ansible-project] Re: Getting Error while executing Commands having space in command module and shell module

2017-01-20 Thread Johannes Kastl
On 20.01.17 09:27 sgamp...@criterionnetworks.com wrote: > I tried using complete command "onos-karaf clean" as well but its > not working its giving me same error as you can see > > error message: failed: [192.168.2.129] (item=onos-karaf clean) => > {"cmd": "onos-karaf clean", "failed": true,

[ansible-project] Re: Getting Error while executing Commands having space in command module and shell module

2017-01-20 Thread sgampawa
I tried using complete command "onos-karaf clean" as well but its not working its giving me same error as you can see error message: failed: [192.168.2.129] (item=onos-karaf clean) => {"cmd": "onos-karaf clean", "failed": true, "item": "onos-karaf clean", "msg": "[Errno 2] No such file or

Re: [ansible-project] using docker:xenial image in chrismeyersfsu/provision_docker role

2017-01-20 Thread Johannes Kastl
On 19.01.17 20:28 Mathias Aldrin wrote: > I can specify the image ubuntu:xenial but I do not know how to pre load > this image with python 2.7 (requirement for ansible). > Creating the docker containers manually I would create a Dockerfile > defining the pre installed SW. I would guess that

Re: [ansible-project] Variables from csv and loops with random records

2017-01-20 Thread Johannes Kastl
On 19.01.17 11:48 Mátyás Kovács wrote: > Hi! > > Thanks for the advice, I like it. But, I have a syntax error with this: > > --- > - hosts: all > tasks: > - iptables_raw: The indentation is wrong, the dash should be indented as tasks is: - hosts: all tasks: - iptables_raw: