[ansible-project] log_plays call back plugin

2017-10-02 Thread sanjeev ganjihal
I have a question with the callback plugin log_plays.py. Under requirements I see whitelist. Whitelist in configuration: Can you elaborate on what I should add there? In ansible.cfg I uncommented *callback_whitelist = timer, mail.. *Anything else that I should do?Can someone please guide me?

Re: [ansible-project] Is there a way to provide default values to a set of tasks?

2017-10-02 Thread Pshem Kowalczyk
I'm not aware of any generic way of providing those sort of values. Some modules provide their own way of using environmental variables or external config files to facilitate what you're asking for. kind regards Pshem On Tue, 3 Oct 2017 at 13:02 Behrang Saeedzadeh wrote:

Re: [ansible-project] Is there a way to provide default values to a set of tasks?

2017-10-02 Thread Behrang Saeedzadeh
Hi Pshem, Looks like my question was not phrased clearly enough. It is not about defining variables, I already use group, host, role, and play variables in my various Ansible projects. Let's pretend we have defined these variables: my_validate_certs: False my_method: POST my_user: admin

[ansible-project] Re: Able to change execution order of with_items?

2017-10-02 Thread John Harmon
I have it kind of ugly, but it works. ANSIBLE_CONFIG is an environment variable I can work with. I have to export it to get it to work. I set it to what I need for this one playbook, and then set it back to the default after it is complete. 1 2 1 1-12/3 * export

[ansible-project] Re: Able to change execution order of with_items?

2017-10-02 Thread John Harmon
I have a way to do this, but am looking for improvements. If I change the "forks =" setting in the ansible.cfg file, then this works exactly the way I want it to. I don't mind creating a custom ansible.cfg file (ie ansible_1fork.cfg), but I don't yet see a way to call the playbook with the

[ansible-project] Able to change execution order of with_items?

2017-10-02 Thread John Harmon
I have the following in my playbook, and when it writes the contents it writes in this format: ServerA: sudoers ServerB: sudoers ServerA: other_users ServerB: other_users. I would like the following format if possible: ServerA sudoers ServerA other_users ServerB sudoers ServerB

[ansible-project] Able to force execution order or with_items?

2017-10-02 Thread John Harmon
I have the following in my playbook, and when it writes the contents it writes in this format: ServerA: sudoers ServerB: sudoers ServerA: other_users ServerB: other_users. How can I get this to write ServerA sudoers and other_users first, and then move on to serverB? and so on/ -

[ansible-project] Re: Execute one email/command per play, no matter how many servers

2017-10-02 Thread John Harmon
Answered it myself. run_once: true -- 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...@googlegroups.com. To post to this group,

[ansible-project] Execute one email/command per play, no matter how many servers

2017-10-02 Thread John Harmon
I have a play that is setup to email me once complete with some of the resultsthe problem is that I get an email for every server I run the play against. For instance, against 1 server I get 1 email. Against 3 servers I receive 3 identical emails. How can I get a particular task to just

[ansible-project] Getting stdout_lines from {{item}} properly

2017-10-02 Thread John Harmon
The following code fails, but I am unsure why. Individually, instead of calling {{item}} I can call var.stdout_lines. What is the correct syntax? - name: Write users lineinfile: dest: "/tmp/users.txt" line: "HOST: {{ansible_nodename}}\n{{item}}\n\n" insertafter: EOF create:

[ansible-project] Syntax for role dependencies in meta/main.yml?

2017-10-02 Thread ZillaYT
I'm playing with role dependencies using git repos What is the syntax for role dependencies in the role's meta/main.yml file? I've tried meta/main.yml --- dependencies: - role: "git+ssh://git/path/some_repo" or -{role: "git+ssh://git@path/some_repo"} It's an Atlassian Bitbucket repo,

Re: [ansible-project] How to set current directory in ansible.cfg?

2017-10-02 Thread ZillaYT
I know I can... $ ansible-galaxy install -r requirements.yml -p ./roles On Monday, October 2, 2017 at 3:17:01 PM UTC-4, ZillaYT wrote: > > Ah. I want to set it b/c I want to run the following to clone the roles > defined in my current playbook's requirements.yml file in a roles >

Re: [ansible-project] How to set current directory in ansible.cfg?

2017-10-02 Thread ZillaYT
Ah. I want to set it b/c I want to run the following to clone the roles defined in my current playbook's requirements.yml file in a roles sub-directory relative to my playbook. $ ansible-galaxy install -r requirements.yml So if my playbook is in /home/myuser/ansible-plays/myplaybook.yml

Re: [ansible-project] How to set current directory in ansible.cfg?

2017-10-02 Thread Brian Coca
That is my point, i don't recommend ever using 'cur dir', if invoking a play, it already uses a roles/ dir adjacent to the play, I would use that or a directory set by configuration. -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups

Re: [ansible-project] How to set current directory in ansible.cfg?

2017-10-02 Thread ZillaYT
Thanks. So what is the recommended way for setting roles_path to be /roles for example? On Monday, October 2, 2017 at 3:01:32 PM UTC-4, Brian Coca wrote: > > In 2.4 and above you can use {{CWD}}, i still don't recommend it as > it is a security risk (cd /tmp; ansible-playbook

Re: [ansible-project] How to set current directory in ansible.cfg?

2017-10-02 Thread Brian Coca
In 2.4 and above you can use {{CWD}}, i still don't recommend it as it is a security risk (cd /tmp; ansible-playbook ~/security/play.yml) -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this

[ansible-project] How to set current directory in ansible.cfg?

2017-10-02 Thread ZillaYT
I want to set a roles_path = ${curr_dir}/roles, but how do I set curr_dir to my current directory where I run ansible-playbook command in my ansible.cfg file? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group

[ansible-project] filter_plugins cannot be used inside role defaults

2017-10-02 Thread Deniz Acay
Hi, We recently migrated to Ansible v2.4 and having issues related to using our role-specific custom filter plugins in role defaults. In previous version, this worked: - myrole - defaults - filter_plugins - tasks We could use filter plugins defined in this role in the defaults

Re: [ansible-project] newline characters in shell commands

2017-10-02 Thread Kai Stian Olstad
On 27. sep. 2017 00:55, rurpy via Ansible Project wrote: Hello, I am new to Ansible and trying to see if it fits my needs but quickly ran into the following problem: $ ansible ubtest -m shell -a 'echo -n "line 1\nline 2" >/tmp/foo' /tmp/foo is created with one line containing the two

Re: [ansible-project] Out of scope variable in jinja2 template started throwing error after i updated to jinja2 2.9

2017-10-02 Thread Brian Coca
You'll probably get a better chance for an answer by asking the Jinja2 project - -- 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

Re: [ansible-project] ansible_user undefined when used in become_user:

2017-10-02 Thread Brian Coca
Just to note, that if it 'worked', become_user: "{{ansible_user}}" would be a noop as the become system would ignore this by default as you are already THAT user. Also, debug does not get many of these things set as it has no connection, it always executes 'locally' and ignores connection

Re: [ansible-project] Identify if host being processed is the first in any the groups being processed

2017-10-02 Thread Brian Coca
something like this? when: inventory_hostname in (groups|map('first')|list) though you might want to remove all and empty groups first -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group

Re: [ansible-project] Identify if host being processed is the first in any the groups being processed

2017-10-02 Thread Kai Stian Olstad
On 02. okt. 2017 17:15, Marc L wrote: Hi, That is close, but that still needs the name "dev_cluster" in the cpmparison function. I am more looking for something that determines if the inventory_hostname is the first server in either of the groups specified in the play. The groups may change

Re: [ansible-project] Managing Thunderbird and Firefox using Ansible

2017-10-02 Thread Kai Stian Olstad
On 02. okt. 2017 00:56, Pietro Leone wrote: Hi, I have to manage some Thunderbird and Firefox (installation and configuration), is there any ansible module that allow me to do this? There are no module for this. But there are some roles for Firefox at least, search Galaxy and/or Github. --

[ansible-project] Re: vmware_guest module: Customization of the guest operating system 'centos64Guest' is not supported in this configuration

2017-10-02 Thread Sebastien Desbois
Hello Limitation of your version of vCenter Centos 7 Guest customization is supported for vSphere 6 (https://partnerweb.vmware.com/programs/guestOS/guest-os-customization-matrix.pdf) but your vCenter build is way too old. Current build : 5318200 Le vendredi 29 septembre 2017 13:25:16

[ansible-project] Ansible 2.3.3 RC1 is available for testing!

2017-10-02 Thread James Cammarata
Hi all, we're happy to announce that RC1 for 2.3.3 is now available for testing. How do you get it? -- The tar.gz of the release can be found here: http://releases.ansible.com/ansible/ansible-2.3.3.0-0.1.rc1.tar.gz SHA256:

Re: [ansible-project] Ansible playbook xml module - error when using in task

2017-10-02 Thread Dick Davies
If you just create a library/ folder and put the xml module in there, it'll work. We've been using the xml module since 2.0 this way, it works fine. On 2 October 2017 at 16:04, Sivakumar Lakshminarayanan wrote: > Sorry missed to see that, my bad. > Bad luck in our

[ansible-project] Re: Nested loop. Write var to file before moving on to next {{item}}

2017-10-02 Thread John Harmon
That did come in helpful, thank you. It helped me to format the output nicely. -- 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

Re: [ansible-project] Identify if host being processed is the first in any the groups being processed

2017-10-02 Thread Marc L
Hi, That is close, but that still needs the name "dev_cluster" in the cpmparison function. I am more looking for something that determines if the inventory_hostname is the first server in either of the groups specified in the play. The groups may change across environments, so the task needs to

[ansible-project] Ansible Bug: skipping no hosts matched

2017-10-02 Thread 'Colm Mcnabola' via Ansible Project
Hi All I am having an issue with ansbible. I have created an inventory folder and declared a hostgroup for different nodes for example, in inventory file [NodeGroup1] no...@node.node [NodeGroup2] no...@node.node no...@node.node This inventory is stored under /environment/testEnv When

Re: [ansible-project] Ansible playbook xml module - error when using in task

2017-10-02 Thread Sivakumar Lakshminarayanan
Sorry missed to see that, my bad. Bad luck in our office repository we will have ansible 2.3* only. Thanks On Sunday, October 1, 2017 at 7:23:48 PM UTC+8, Andreas Olsson wrote: > > lör 2017-09-30 klockan 22:41 -0700 skrev Sivakumar Lakshminarayanan: > > When trying ansible xml module... > >

[ansible-project] Re: Ansible: vmware_module does not work and flashes the error "Failed to find a matching datastore"

2017-10-02 Thread Sebastien Desbois
Hello, I did some tests with your snippet. This is not working and it's normal. Either you create the VM based on a template, and the result will be by default in the same datastore as the the template, or you create a VM from scratch and you specifu the disk parameters (size, type,

[ansible-project] Out of scope variable in jinja2 template started throwing error after i updated to jinja2 2.9

2017-10-02 Thread ishan jain
My previously running playbooks starting giving me error after i updated my python modules. After a lot of debugging, i identified the problem. The problem was that following code snippet was working fine until i updated jinja2 to 2.9 {% for dictValue in someDictVar -%} #something something {%

[ansible-project] Re: windows ansible powershell in 2.3.1

2017-10-02 Thread anil kumar
It is Windows Server 2008 R2 standard. Is this bug fixed in it 2.4? I am using the script for creating the object in Activer Directory OU only for both windows and linux machine, not sure if this module work for linux machine as the joining the domain process is differnt from windows. in any

[ansible-project] Re: ansible_user undefined when used in become_user:

2017-10-02 Thread Jerome Wagner
After a bit of research, I ended up understanding that the problem comes from the sequence that creates the context. during task execution, "ansible_user" is considered a magic variable, that is created out of "remote_user". but it is added to the task variables context only after the

Re: [ansible-project] Suggestion: telnet transport for network devices?

2017-10-02 Thread Rodrigo
Hello Steve, I have some idea about this topic and we know in Ansible 2.4 we have module to execute telnet on device. The point that is figure out now to access device via this module and implement some scripts in IOS Cisco devices to enable SSH. However, my problem now is working with some

Re: [ansible-project] Identify if host being processed is the first in any the groups being processed

2017-10-02 Thread Matthew Wyant
Yes, there is a "groups" variable which is a dictionary with group name keys where the values are a list of hosts in that group. That is, groups[dev_cluster] = ["server1", "server2", "server3"]. So you can do a inventory_hostname == groups[dev_cluster][0] comparison for the first item. Note: I

[ansible-project] Identify if host being processed is the first in any the groups being processed

2017-10-02 Thread Marc L
I have some tasks that should only be processed if the host (inventory_hostname) is the first in the group of servers it's defined in. For example, here is my hosts file. Note that the group names are not fixed - the Role I want to use them in cannot rely on the name of the groups - it needs

[ansible-project] Re: ansible_user undefined when used in become_user:

2017-10-02 Thread Jerome Wagner
Let me add that I encounter the "ansible_user" is undefined issue with both stable-2.3 and stable-2.4 branches of the code. Le samedi 30 septembre 2017 21:32:08 UTC+2, Jerome Wagner a écrit : > > Hello, > > I thought that when ansible-playbook was used with the "-u" option, then > ansible_user

Re: [ansible-project] Is there a way to provide default values to a set of tasks?

2017-10-02 Thread Pshem Kowalczyk
Hi, If you want to use 'global' variables like that you have a few choices: 1. Use 'group_vars/all.yaml' (all hosts belong to 'all' group by default) 2. Use 'defaults/main.yaml' under your role more info here: http://docs.ansible.com/ansible/latest/playbooks_best_practices.html#directory-layout

Re: [ansible-project] Re: Ansible option to playbook

2017-10-02 Thread nbmprivat
Thanks Brian, I'll ask another way. How do I retrieve system information on servers without using the plugin 'setup'? Den fredag den 29. september 2017 kl. 15.27.52 UTC+2 skrev Brian Coca: > > --tree is only an option for `ansible` .. not ansible-playbook, there > is no keyword to do the same