Re: [ansible-project] How to create multiple folders with loop in ansible

2015-10-02 Thread Evgen Morokin
Hello Deborah, Please find screenshot attached with some explanations, hope it will help. Sincerely, Evgen On Friday, October 2, 2015 at 5:53:07 AM UTC-4, DEBORAH A

Re: [ansible-project] How to create multiple folders with loop in ansible

2015-10-02 Thread Evgen Morokin
Hello Deborah, Please find screenshot attached with some explanations, hope it will help. Sincerely, Evgen On Friday, October 2, 2015 at 5:53:07 AM UTC-4, DE

Re: [ansible-project] Idempontent maintenance of a cfg file

2015-10-02 Thread Jason Gilfoil
Ahh ok, I see. I didn't realize templates did comparisons before copying. Thanks for your help! On Friday, October 2, 2015 at 7:43:07 PM UTC-4, Brian Coca wrote: > > template would not force unnecessary changes, it is your best bet for > idempotency. > > -- > Brian Coca > -- You received th

Re: [ansible-project] Idempontent maintenance of a cfg file

2015-10-02 Thread Brian Coca
template would not force unnecessary changes, it is your best bet for idempotency. -- Brian Coca -- 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-pro

[ansible-project] Idempontent maintenance of a cfg file

2015-10-02 Thread Jason Gilfoil
Hi All, I'm learning Ansible and am preparing to try and execute both deployment and configuration maintenance on a few systems at work. One configuration file in particular is giving me issues however. I want to be able to update Min and Max Instances in this section of a cfg file: ... [PSAPP

[ansible-project] Re: passing variables to docker module

2015-10-02 Thread Tony Owens
I asked a little too soon. I just needed to use the variables from group_vars like this: env: DOCKER_DB: "{{DOCKER_DB}}" JNDI: "{{JNDI}}" FAKE_VAR: "{{FAKE_VAR}}" ANOTHER_FAKE_VAR: "{{ANOTHER_FAKE_VAR}}" On Friday, October 2, 2015 at 9:15:45 AM UT

[ansible-project] Re: Variable substitution in uri module

2015-10-02 Thread michael
I solved the problem after a lot of digging. In case it's of use to anyone else: https://github.com/ansible/ansible/issues/7005 On Thursday, October 1, 2015 at 4:02:29 PM UTC-4, mic...@networktocode.com wrote: > > Hi all, > > Similar to > https://groups.google.com/forum/#!topic/ansible-project/

Re: [ansible-project] module development and 'with_items'

2015-10-02 Thread Tim Chambers
FWIW, that code uses type(name) == type(''): etc., where isinstance(name,str ): (same for list) would be much more Pythonic. On Monday, January 6, 2014 at 5:52:59 PM UTC-7, Dmitry Makovey wrote: > > I think I've got it: > > http://pastebin.com/NCgAhVjF > > ... > -- You received this message be

Re: [ansible-project] include_vars overrides subsequent role's vars/main.yml

2015-10-02 Thread Dan Stillman
I think that's the issue I reported here: https://github.com/ansible/ansible/issues/11996 Initially closed as a "possible misunderstanding", then acknowledged as broken on 1.9 and fixed on 2.0, then broken again on 2.0, and the issue was left closed. Seems pretty clear to me that it's not the

Re: [ansible-project] Include the correct var file depending on the hostname

2015-10-02 Thread Brian Coca
group_vars always get loaded for all servers in the group, include_vars is not meant for group/host_vars -- Brian Coca -- 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

Re: [ansible-project] Re: setting up new control from source - getting 'FAILED => winrm is not installed' targeting existing Win clients

2015-10-02 Thread Eric Herrmann
I encountered this too. "pip list" showed "pywinrm" installed and "/usr/local/lib/python3.4/dist-packages/winrm/" existed on my filesystem, however Ansible kept giving me the error, as well as... eric.herrmann@ubuntu-VirtualBox:~$ python Python 2.7.9 (default, Apr 2 2015, 15:33:21) [GCC 4.9.2]

[ansible-project] Include the correct var file depending on the hostname

2015-10-02 Thread Samnang Sen
I have three sets of servers. Depending on the hostname, I want the client to grab the correct file. I tested the playbook on a server with the word "batch" but it picks up both files (group_vars/perl and group_vars/perl). pre_tasks: - include_vars: group_vars/web when: "'web' in ansible_h

[ansible-project] Multiple instances of the same software on a machine

2015-10-02 Thread Dale
Hi Im working on an ansible role that allows an application with a distributed architecture to be installed on a set of machines. The architecture consists of N independent nodes, which operate within their own address space and communicate through HTTP. So far everything seems straightforwar

Re: [ansible-project] Possible to use sub-directories in files

2015-10-02 Thread Brian Coca
just do this: with_items: - migrations/V1_1__SetupSchemas.sql -- Brian Coca -- 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...

[ansible-project] Possible to use sub-directories in files

2015-10-02 Thread j.barrett Strausser
Is it possible to use subdirectories when copying files? I have a play like - name: Copy Migration Files copy: src={{item}} dest=/opt/flyway/sql/ tags: migrate with_items: - V1_1__SetupSchemas.sql Right now the V1_1__SetupSchemas.sql lives in /toplevel/roles/myrole/files/. I would like

[ansible-project] How to pass a dictionary variable to an ansible module

2015-10-02 Thread samir
Hi, I want to know how can I pass a dictionary (ansible fact) as a variable to another module. Following are the details: I gather my ansible fact using the following code: - name: Gather information from lldp lldp: - name: Printing LLDP information gathered debug: msg="{{ lldp}}" The g

Re: [ansible-project] How to set an environment variable on Linux distro for a user using ansible playbook?

2015-10-02 Thread Pratik Dhandharia
Thanks for clarifying my understanding and suggesting a workaround. It worked! On Thursday, October 1, 2015 at 7:18:39 PM UTC-4, Brian Coca wrote: > > source is not a command its a builtin in bash, ansible uses /bin/sh if > it is not a symlink to bash or bash is set to do strict sh you won't

[ansible-project] Re: Plays against different server groups in playbook

2015-10-02 Thread Dimitri Yioulos
Hey, Brian. I was using the "l" switch, thereby limiting the playbook run to a subset of servers. In this case, there was no need for such limiting (and, in fact, it caused the playbook to work incorrectly). How stupid of me. So, allow me to post the entire playbook: --- - hosts: admin2

[ansible-project] Ansible 1.9.4-rc3 is available for testing

2015-10-02 Thread James Cammarata
Hi all, we've just tagged the rc3 release for 1.9.4, which fixes a bug related to the yum module introduced in the rc2 release. To test from source, simply clone the git repository (if you haven't already) and do the following: $ git checkout v1.9.4-0.3.rc3 $ git submodule update $ . hacking/env-

[ansible-project] Re: passing variables to docker module

2015-10-02 Thread Tony Owens
As an example. I know that i can include variables like this: - name: run hello docker container docker: docker_api_version: 1.18 name: hello registry: "docker.registry.dv.mycompany.com" pull: always image: docker.registry.dv.mycompany.com/towens/hello:l

Re: [ansible-project] Re: Plays against different server groups in playbook

2015-10-02 Thread Brian Coca
Dimitri, not sure what you mean by "ansible-playbook -l serversA playbook.yml" don't worry about using up goodwill, i never had any to begin with -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this

[ansible-project] Re: Disable Nagios Alerts

2015-10-02 Thread Dimitri Yioulos
Veera, There's an Ansible module for nagios: http://docs.ansible.com/ansible/nagios_module.html. I use it, and it works well. Dimitri On Friday, October 2, 2015 at 7:45:08 AM UTC-4, veera kumar wrote: > > Hi All, > > Can anyone tell me how to automatically disable nagios and new relic > ale

[ansible-project] passing variables to docker module

2015-10-02 Thread Tony Owens
Any tips on reading in the group_vars and making them available to the docker module via "env"? I have searched for examples. I know that i can call out key:values. I don't know if i'm missing something for using group_vars with docker run and ansible? -- You received this message because y

[ansible-project] overwrite dictionary variables in playbooks

2015-10-02 Thread Co S
Hi All, I have something like this defined in vars which is being passed as 'instance.volumes' variable later in tasks like this volumes: "{{ instance.volumes }}". instance: volumes: - device_name: /dev/sda1 And I need in playbook during execution time to replace '/dev/sda1' value with

[ansible-project] Re: Plays against different server groups in playbook

2015-10-02 Thread Dimitri Yioulos
Hi, Brian. Yes, I understand about the playbook running one or more plays. What I didn't understand (and this is another of my embarrassing mistakes) is that I shouldn't have identified any servers or groups when running the playbook, as in "ansible-playbook -l serversA playbook.yml" but, rath

Re: [ansible-project] Re: template + delegate_to + ssh shared connections = closed connections

2015-10-02 Thread Chris May
--user root For me at least, and I know this won't be available for everyone seems to get around this particular issue. On Saturday, 15 August 2015 05:58:19 UTC+1, Roger Sherman wrote: > > I'm having this same issue. Is there any fix for this yet, or is it just > use the workaround of using pa

[ansible-project] Disable Nagios Alerts

2015-10-02 Thread veera kumar
Hi All, Can anyone tell me how to automatically disable nagios and new relic alerts using ansible playbook. If possible please provide some samples. Thanks in advance. Regards, Veera -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsu

[ansible-project] Re: vsphere_guest gather_vmware_facts not returing ip addresses of vms running in esx hypervisor v5.5.0

2015-10-02 Thread Rich Brantingham
Did you manage to solve this? I'm running into the same problem, except the response I get from vmware_guest_facts contains the correct field (ipaddress), it's just populated with 'null'. Any pointers appreciated. On Monday, December 29, 2014 at 7:58:59 PM UTC, Earl Robinson wrote: > > When us

[ansible-project] Re: centos 6.5 issue

2015-10-02 Thread Mohammad Asshad
Hi, I had the same problem earlier, and updated yum update openssh, issue has been resolved. Regards, Asshad On Monday, July 28, 2014 at 9:43:21 PM UTC+8, Mike Simonson wrote: > > Hi, > > I am using ansible to provision a vagrant box that's running with > virtualbox on a centos 6.5 host. > >

[ansible-project] include_vars overrides subsequent role's vars/main.yml

2015-10-02 Thread t goto
Hello, experts. Let me ask you about weird behavior between include_vars and role variable. I have a couple of roles, "test_before" and "test_after" . `-- test_before |-- tasks | `-- main.yml `-- vars `-- RedHat.yml |-- test_after | |-- tasks | | `-- main.yml | `-- va

[ansible-project] hostvars with variables for different hosts

2015-10-02 Thread Roman Belyakovsky
Hello! Let's say I have a simple dictionary in host_vars or group_vars: host_presets: hostname: "{{ inventory_hostname.split('.')[0] }} domain: "{{ inventory_hostname| regex_replace('^' + inventory_hostname. split('.')[0] + '\\.', '')}}" It works perfectly till I try to get it for other host w

[ansible-project] Re: Parsing for win_updates reboot hint

2015-10-02 Thread J Hawkesworth
the when: doesn't really default to true. Instead when: just needs to 'see' a true or a false. It doesn't care if that is from finding a value of true or false by looking up what is stored in a variable or by running something that returns a true or false. adding the '== true' makes the when:

Re: [ansible-project] Conditional Variable Prompt using when

2015-10-02 Thread Chris Kerr
This seems to have sorted it! lib_dir_version: "{{ (version_no == '12')|ternary('12','11') }}" single quoted the value '12' Brian Thanks for the heads up - Pointed me properly in the right direction Thank you! Chris On Friday, 2 October 2015 08:46:36 UTC+1, Chris Kerr wrote: > > Thanks for

Re: [ansible-project] Howto Trigger an action based on the result of a previous action and pull in data from a dictionary

2015-10-02 Thread chris scott
Finally got a chance to look at this again. Thanks for the pointer Brian you were spot on, and as a result its all far cleaner now. --- - hosts: all gather_facts: no vars_files: - ~/.userlist.yml tasks: - name: Is user on this system? action: getent database=passwd no_log

Re: [ansible-project] Conditional Variable Prompt using when

2015-10-02 Thread Chris Kerr
Thanks for the response Brian So far I have changed the syntax to the following: (Had to wrap the version_no == 12 in ( ) to supress `False` passing through. lib_dir_version: "{{ (version_no == 12)| ternary('12','11') }}" If I enter 11 in my prompt - I get the expected echo of echo "My lib di