Re: [ansible-project] Using include_vars and with_items with optiona files == bug?

2017-07-10 Thread Brian Coca
Well, this is not include_vars behaviour but 'merge loop results behaviour' that affects all modules as this is result processing. The other part of 'saving intermediate results' would also affect all tasks. I doubt either will change in the future. -- Brian Coca -- You received this

Re: [ansible-project] Using include_vars and with_items with optiona files == bug?

2017-07-10 Thread Dan Linder
I'm falling back to the six tasks for now (three stat file, three include when exists). In my mind this is a bug; the "ignore_errors" setting should let it keep the partial result. The parallel being that the file module could partially succeed in setting a file owner but SELinux or other meth

Re: [ansible-project] Ansible log_path to also include the command line that invoked ansible-playbook?

2017-07-10 Thread Kai Stian Olstad
On 10. juli 2017 22:39, burns...@umn.edu wrote: It does a great job of tracking tasks and status, but I can't see the command itself. Would be helpful to know if a tag was skipped, command line var was passed, or other command line change that isn't immediately clear by the output. I recommend

[ansible-project] Re: Ansible Windows: Add account to group administrators FR/US

2017-07-10 Thread Jordan Borean
Hey One thing you can do is use the win_region module https://docs.ansible.com/ansible/win_region_module.html to change the region of your hosts to a common value. If this isn't what you can do, you can also run an adhoc command to determine the group name based on the SID. Give the below task

[ansible-project] Ansible log_path to also include the command line that invoked ansible-playbook?

2017-07-10 Thread burns498
Question - Is it also possible for Ansible log_path to log the actual command that was used to invoke the ansible-playbook? It does a great job of tracking tasks and status, but I can't see the command itself. Would be helpful t

Re: [ansible-project] Using include_vars and with_items with optiona files == bug?

2017-07-10 Thread Brian Coca
The merge setting will affect the result of the task, but not the internal iterator of the task. You might want to make this 3 tasks or use vars_files. -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscrib

Re: [ansible-project] Using include_vars and with_items with optiona files == bug?

2017-07-10 Thread Dan Linder
I forgot to add that I've defined the hash_behaviour to "merge" just for this express purpose of keeping and stacking/appending variables so the normal behavior is suppose to be modified here. On Monday, July 10, 2017 at 2:59:22 PM UTC-5, Brian Coca wrote: > > Well, when you include_vars you are

[ansible-project] Re: Add user to "administrators" group or "administrateurs" group

2017-07-10 Thread 'J Hawkesworth' via Ansible Project
I suggest you run the 'setup' module against your hosts, and use one of the facts to find out if the machine is FS or US. For windows hosts, ansible_facts.ansible_env.USERNAME might be enough. If that isn't enough, on windows hosts you can use the Get-Culture cmdlet to find out which culture

Re: [ansible-project] Using include_vars and with_items with optiona files == bug?

2017-07-10 Thread Brian Coca
Well, when you include_vars you are normally overwriting existing vars, this will happen in a with_ loop or outside of it, that is normal behaviour. As for the error wiping out myvars ... the task failed, so none of the work was done. The previously accumulated data in the 2 files that did work is

[ansible-project] Using include_vars and with_items with optiona files == bug?

2017-07-10 Thread Dan Linder
I'm trying to setup a hierarchical set of variable files so that different teams can setup value, permitting more specific instances to override generic ones. The key is that the more specific instances may not be defined in all cases. I thought I solved it with a combination of "include_vars

[ansible-project] Connecting to Cisco IOS device through Cisco terminal server (29xx)

2017-07-10 Thread coolcps
I would like Ansible to connect to the console port of IOS devices to provision them. I have set up a Cisco 29xx terminal server to use SSH. The issue is that in order to access the device, you must now go through two prompts. The first prompt username/password, then hit Enter to bring up th

[ansible-project] Re: Cisco switch unreachable

2017-07-10 Thread Phil F
Yeah I should have done a search first - thanks, fixed :-) On Monday, 10 July 2017 17:46:52 UTC+2, Phil F wrote: > > Hi, > > I have just installed Ansible for the first time and am attempting to > connect to a Cisco switch, this needs to be with username and password. > > From both an Ubuntu serv

Re: [ansible-project] Not able to use ec2_vpc_endpoint module

2017-07-10 Thread Kai Stian Olstad
On 10. juli 2017 12:35, shuvam jha wrote: Hi , I am using ansible 2.3.1.0 , python version = 2.7.5 . When i am trying to use ec2_vpc_endpoint module it is giving error , but i am able to run other ec2 or aws modules . I have checked the list of module by running ansible-doc -l , ec2_vpc_endpoi

Re: [ansible-project] Ansible dynamic variable

2017-07-10 Thread Kai Stian Olstad
On 10. juli 2017 00:50, Kethzer Docteur wrote: Im trying to have ansible Update variable value base on OS distribution, but Im faling when I insert the rules in a template. Any idea how to solve this? --- - hosts: fansible,cansible vars: nagios_freebsd_load: -w 75,70,65 -c 90,85,80

Re: [ansible-project] Cisco switch unreachable

2017-07-10 Thread Kai Stian Olstad
On 08. juli 2017 13:17, Phil F wrote: Hi, I have just installed Ansible for the first time and am attempting to connect to a Cisco switch, this needs to be with username and password. From both an Ubuntu server and my Mac I can ssh to the box with the same username and password I have configur

[ansible-project] Role tag?

2017-07-10 Thread Dick Visser
Hi I'm often finding myself having to run a specific role from some of our playbooks. Currently I'm using the '--tags' option for ansible-playbook, and we tag the role in our playbook like this: roles: - somerole - another_role - { role: myrole, tags: myrole } - yetanotherrole But now

[ansible-project] How to put an array in a json object.

2017-07-10 Thread VenomMsk
Hi, I have a varible that contains an array: "AuthenticationHTTPheader": [ "iv-user", "iv-groups" ], I need to pass this walue as a JSON-element in a body of a Request sent by URI module. So, body: '{

[ansible-project] Ansible to assign an IAM role to an existing instance

2017-07-10 Thread Bond
Hi, I am trying to assign an IAM role to a bunch of existing EC2 instances using Ansible modules. I couldn't find an appropriate module for that same and wasn't sure if that is possible since this feature came out recently. Any suggestions? -- You received this message because you are subscr

[ansible-project] Ansible customization on vmware environment

2017-07-10 Thread Alessio Dini
Hello, I'm working on ansible using vmware_guest module. Actually customer makes new vms using powercli utility leaving them: - running - with nic interfaces ( no ip, netmask, gw, etc.etc. ) - with multiple disks I want to use ansible configuring ip address,hostname,gw and dns server on the

[ansible-project] Ansible Windows: Add account to group administrators FR/US

2017-07-10 Thread fanchfanch44
Hello, I'm starting with Ansible. I would like to know in a playbook how to test if the windows computer is in version FR or US. Following the test, I would add account users to the local "Administrators" or "Administrateurs" group. By default: - name: Add a user Hosts: windows_tst Gathe

[ansible-project] Re: Ansible Tower installation Failed with error

2017-07-10 Thread Kean Loong Mak
Have you managed to solve this? I went through the repositories on /etc/yum.repos.d/, and it turns out Ansible had installed its own repos inside as part of setup - which clashed with the repos already in there. You'll have to identify which, and rename the affected repos for the time being. O

[ansible-project] Re: Cisco IOS backup and write to file with timestamp

2017-07-10 Thread Murugan Gan
Hi Team, I have created sh running config getting output but have 150 routers but it triggered one notepad text it include all config output any chance to get trigger each host name with each text output. Regards, S.Manivannan On Friday, September 30, 2016 at 3:25:22 PM UTC-7, Jimbo

[ansible-project] Ansible Configuration property - executable and quoting

2017-07-10 Thread etcshadow
Hello, I would like to ask if there is a why to set "executable=" configuration property to nothing as I don't want to spawn another shell for the sudo elevation. Cause I am not allowed to. The issue I faced is related to the quotes followed by the executable which makes Ansible not being able

[ansible-project] Ansible dynamic variable

2017-07-10 Thread Kethzer Docteur
Im trying to have ansible Update variable value base on OS distribution, but Im faling when I insert the rules in a template. Any idea how to solve this? --- - hosts: fansible,cansible vars: nagios_freebsd_load: -w 75,70,65 -c 90,85,80 nagios_centos_load: -w 15,10,5 -c 30,25,20 na

[ansible-project] Cisco switch unreachable

2017-07-10 Thread Phil F
Hi, I have just installed Ansible for the first time and am attempting to connect to a Cisco switch, this needs to be with username and password. >From both an Ubuntu server and my Mac I can ssh to the box with the same username and password I have configured in the ansible inventory. I have a

[ansible-project] Not able to use ec2_vpc_endpoint

2017-07-10 Thread shuvam jha
Hi , I am using ansible 2.3.1.0 , python version = 2.7.5. I am trying to use ec2_vpc_endpoint module , but it is giving error. I have use other ec2 or aws module . I have updated the ansible . I have run ansible_doc -l to check list of module it was not there . Error : ERROR! no action detect

[ansible-project] Migrating from Serena to Ansible

2017-07-10 Thread manasi
Hi All , We are planning on migrating to Ansible. But need to know like How to migrate from Serena deployment automation to Ansible and how to go about it? What dependencies need to be handled and things that need to be converted? Thank you. Manasi -- You received this message because you a

[ansible-project] How to do parameterized ansible-variable attribute-lookups?

2017-07-10 Thread moe_22
This is best explained by this simple example: --- - name: getattr hosts: 127.0.0.1 connection: local vars: - foo: bar: "bar" baz: "baz" - bee: "bar" tasks: - name: get foo.bar debug: msg: "{{ foo|attr(bee) }}" ... This fails, why? -- You received this m

[ansible-project] Add user to administrators or administrateurs group

2017-07-10 Thread fanchfanch44
Hello, I would like to create a playbook that adds a user to the "administrators" group. his action is simple and is an example. But my problem is that I have servers in FR and the group is not "administrators" but "administrateurs". I saw that we could make conditions in the playbooks but I d

[ansible-project] Why parameterized attribute lookup on ansible variables fail?

2017-07-10 Thread moe_22
This is best explained by this example: --- - name: getattr hosts: 127.0.0.1 connection: local vars: - foo: bar: "bar" baz: "baz" - bee: "bar" tasks: - name: get foo.bar debug: msg: "{{ foo|attr(bee) }}" ... This fails, whay? -- You received this messa

[ansible-project] Add user to "administrators" group or "administrateurs" group

2017-07-10 Thread fanchfanch44
Hello, I would like to create a playbook that adds a user to the administrators group. This action is simple and is an example. But my problem is that I have servers in FR and the group is not administrators but administrators. I saw that you could make conditions in the playbooks but I do not

[ansible-project] vmware - Managing several portgroups on a cluster

2017-07-10 Thread Drew Merryman
Hey all, I'm new to Ansible but I'm really liking it so far. However, I think what I'm trying to do is a bit more advanced, or perhaps Ansible isn't the right tool? Here is the problem: Currently I have several datacenters with a varying amount of clusters on each. On the clusters are some ESX

[ansible-project] Not able to use ec2_vpc_endpoint module

2017-07-10 Thread shuvam jha
Hi , I am using ansible 2.3.1.0 , python version = 2.7.5 . When i am trying to use ec2_vpc_endpoint module it is giving error , but i am able to run other ec2 or aws modules . I have checked the list of module by running ansible-doc -l , ec2_vpc_endpoint was not there . How to include that ,

[ansible-project] dynamic inventory not working properly

2017-07-10 Thread Babatunde Busari
Original post https://github.com/ansible/ansible/issues/26574 ANSIBLE VERSION ansible 2.3.1.0 config file = /projects/robomation/ansible.cfg configured module search path = Default w/o overrides python version = 2.7.5 (default, Aug 2 2016, 04:20:16) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] I have

[ansible-project] Attach an IAM role to existing EC2 instances

2017-07-10 Thread Bond
Hi, I am trying to attach and IAM role to a set of existing EC2 instances based on the Tag value. Is there a module readily available in Ansible now? Any suggestions? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this

[ansible-project] Dynamic group from static groups

2017-07-10 Thread B Holmes
Hi, I have an inventory file: [dev] dev_server1 [uat] uat_server1 [prod] prod_server1 variables file: env_lists: - env_list: env_list1 envs: - dev - uat - prod - env_list: env_list2 envs: - prod - env_list: env_list3 envs: - dev - prod I'm trying to ru

Re: [ansible-project] backward incompatible change in module find in ansible 2.3

2017-07-10 Thread Renaud Michel
on 2017-07-06 at 20:27, Kai Stian Olstad wrote: > On 06. juli 2017 13:33, Renaud Michel wrote: > > I suppose it is too late to report this as a bug, as ansible 2.3 has been > > released for some time already, changing it to be compatible with previous > > versions would break it for people who stat

Re: [ansible-project] Playbook Failys atc copying ssh keys

2017-07-10 Thread Anfield
Good point. The fact the playbook has become: yes in it - does that not apply to the commands that run on the localhost and the target? This playbook is just running against the target 10.10.0.5 Maybe I'm misunderstanding the use of the elevated permissions.. > > -- You received this message

Re: [ansible-project] Playbook Failys atc copying ssh keys

2017-07-10 Thread Dick Visser
On 10 July 2017 at 04:39, Anfield wrote: > Yes. Definitely. I even remove the variables in that part, and just put in > /home/dave/.ssh/id_rsa.pub > > Generated the same errors. Permissions perhaps? Keep in mind that you are able to use elevated privileges on the target host, so you have no probl

[ansible-project] Re: Nested variables and Regex...

2017-07-10 Thread rene via Ansible Project
Thanks for helping me out. :) Sadly it looks like that the construct itself is the issue and not the regex. After I resolved the "recursive loop detected in template" issue, I ran into another one. I have to dig into that one first to resolve this entirely. Nevertheless thanks for your help. :