[ansible-project] running shell commands on Windows

2016-09-13 Thread fanvalt
Hello, I did write an Ansible playbook to run on Linux, and now I would like to port it to run on Windows. I would like to list the subdirectories to save it but because I don't know the full name, on Linux did write this play: - name: Lister l installation existante shell: chdir=/{{ Director

Re: [ansible-project] include task and when doesn't completely skip, variables is overwritten.

2016-09-13 Thread Kai Stian Olstad
On 12.09.2016 14:33, Brian Coca wrote: skipping a task does not skip the registering of variables, as this contains the status of the skipped task for latter testing: when: result|skipped Thanks Brian. I'll rewrite my affected roles before upgrade to 2.1. -- Kai Stian Olstad -- You received

[ansible-project] Extend setup module

2016-09-13 Thread Mike Fennemore
We have a internal CMDB that gathers facts from systems using the setup module on playbook execution. Is there a way to extend the setup module to include extra information? >From what I have read the local facts would work for Linux systems but the path wouldn't exist on Windows systems. -- Y

[ansible-project] Re: Extend setup module

2016-09-13 Thread Mike Fennemore
Nevermind, to answer my own question http://docs.ansible.com/ansible/developing_modules.html#module-provided-facts . Although this does add the hassle of adding a custom module to playbooks. It would be nice to have a hook to add a module to run on playbook execution like the setup module thoug

[ansible-project] How can i get the value from a dict of dicts when the key is supplied by a variable ?

2016-09-13 Thread ishan jain
I have prepared a YAML file which arrange some constant values as dictionary of dictionaries: *values:* * key1:* * val1: 1.1* * val2:* * - 1.2.1* * - 1.2.2* * val3:* * - 1.3.1* * - 1.3.2* * val4:* *

Re: [ansible-project] Re: Ansible 2.1.2 RC2 is ready for testing

2016-09-13 Thread John Peacock
On Thursday, September 8, 2016 at 2:55:54 PM UTC-4, James Cammarata wrote: > > Hi John, > > Our roadmaps have been posted here since 2.1: > https://github.com/ansible/ansible/blob/devel/ROADMAP.rst > > I didn't see that, sorry. Since it is now September and there isn't any 2.2rc, I assume that

Re: [ansible-project] Aborting entire playbook when one host unreachable

2016-09-13 Thread Benjamin Redling
On 09/08/2016 08:15, Gustav Karlsson wrote: > Is there a way to abort the entire playbook (even hackish solutions)? [...] > We have tried 'max_fail_percentage: 0', 'any_errors_fatal: true' and > some more hackish solutions, but there just do not seem to be a way... Can you elaborate what you miss

Re: [ansible-project] Re: Extend setup module

2016-09-13 Thread Brian Coca
You might want to weigh in on this proposal https://github.com/ansible/proposals/issues/17 -- 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

[ansible-project] How can i get the value from a dict of dicts when the key is supplied by a variable ?

2016-09-13 Thread Josh Smift
ij> The values for first level of keys (key1,key2) will be provided to the ij> playbook as variable 'key' and i am trying to use the dictionary values ij> corresponding to the dictionary i get from this 'key'. But i am unable to ij> reference this dict within the playbook. I have tried some of thes

[ansible-project] Does Ansible have to run as root? sudo and --become-user

2016-09-13 Thread Mike Schlottman
I have just started looking into Ansible and have built a server on Centos 7. I generally don't run anything as root so I created an ansible account and group and chown -R ansible:ansible /etc/ansible. I assumed that this would be OK, but as I start experimenting with commands, it does not se

[ansible-project] Trouble with mount

2016-09-13 Thread Mateus Interciso
Hello all, I'm veyr new on ansible and currently trying to make some automation with mount. Should be veyr simple, but please take a look at this. This is part of my playbook: - mount: name: "{{ instance.value.mount }}" src: "/dev/{{ instance.value.volume }}/{{ instance.key }}" st

Re: [ansible-project] idea: allow group_vars/ and host_vars/ files to be organised in sub folders

2016-09-13 Thread 'Sean Cavanaugh' via Ansible Project
In this thread though Dehaan said this should work-> > I just tried this on 1.9.1 I have /group_vars/staging/staging.yml and > /group_vars/staging/secrets.yml and it seems to me that it is not merging > the files properly. > But others said this was a problem. I just don't think this is docume

[ansible-project] Variables precedence in dependencies

2016-09-13 Thread Federico Alaimo
Hello, I have a doubt regarding variables precedence: I sometimes have the case where role B depends on role A with role A needing a specific variable value. So in the dependencies file for role B I have something like: dependencies: - { role: role-A, role_a_var1: value1 } But I'm not sure wh

[ansible-project] Include multiple tasks from different roles

2016-09-13 Thread Sunny Bhatheja
I want to include multiple tasks from different roles in a specific order. As of now my playbook looks like --- - name: test play hosts: all tasks: - include: ../roles/common/tasks/{{ item }} with_items: - main.yml - a.yml - b.yml - include: ../roles/ro

[ansible-project] Re: Ansible target not logging to syslog

2016-09-13 Thread mw
yup, -vvv would force logging on target: -v, --verbose verbose mode (-vvv for more, - to enable connection debugging) On Wednesday, July 20, 2016 at 12:46:52 AM UTC-4, Ed S wrote: > > So the change that caused the module and options to stop being logged > turns out to be the addit

回复:[ansible-project] Re: Extend setup module

2016-09-13 Thread lavatar
The fact gathering code lives here: https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/facts.py -- 原始邮件 -- 发件人: Mike Fennemore 发送时间: 2016年9月13日 18:54 收件人: Ansible Project 主题: [ansible-project] Re: Extend setup module Nevermind, to answer

[ansible-project] iosxr_config load config question

2016-09-13 Thread Radoslav Mitov
Hi All, I have a problem with uploading a config file to ios XR box. When i run the play the error is: fatal: [pe2]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_args": {"backup": false, "host": "192.168.1.21", "provider": {"host": "192.168.1.21", "ssh_keyfile": "/home/ra

[ansible-project] Re: Need help with deprecation warnings

2016-09-13 Thread ayush . kumar
Thanks for the sleuthing. It seems like using a "is-defined" check as a conditional is pointless if we have to send everything through default anyway. I understand the change for loops (since it checks each item now), but this behavior seems really counter-intuitive for blocks. What's even the

[ansible-project] privileged execution while local connection loop not working

2016-09-13 Thread John Scancella
hello, I believe that issue https://github.com/ansible/ansible/issues/13763 still isn't resolved as I am experiencing it currently. I am using version 2.0.0.2 Here is an example script that will cause the same error message as in the issue above --- - hosts: 127.0.0.1 connection: local beco

Re: [ansible-project] Does Ansible have to run as root? sudo and --become-user

2016-09-13 Thread Brian Coca
Using --become-user only sets the user, it does not force using become, you need --become to do that. This is because you can set using privilege escalation in the inventory also and this lets you mix/match settings. -- Brian Coca -- You received this message because you are subscribed

Re: [ansible-project] Re: Need help with deprecation warnings

2016-09-13 Thread Brian Coca
blocks let you do 2 things, handle errors and 'share settings', the conditional does not affect the block itself, it is a way to allow all tasks to inherit it, instead of writing it N times. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "An

Re: [ansible-project] Re: Ansible target not logging to syslog

2016-09-13 Thread Brian Coca
The -v option ONLY affects the output you see on the controller. You can set debug in ansible.cfg or ANSIBLE_DEBUG=1 in your environment before running ansible to force some logging on the module side. This mostly affects any commands you shell out for, be mindful that not all modules shell out nor

Re: [ansible-project] privileged execution while local connection loop not working

2016-09-13 Thread Matt Martz
Based on that issue, and the corresponding commit that resolved the problem, the fix does not exist in 2.0.0.2. It was first introduced for the 2.1 release. https://github.com/ansible/ansible/commit/c4cbeeffa89a6265483c187f493bc90ef13bbac9 You would need to upgrade to at least v2.1.0.0-1 On Tue

Re: [ansible-project] privileged execution while local connection loop not working

2016-09-13 Thread John Scancella
Is there any chance that the comment can be updated then to reflect that it didn't actually make it into 2.0? If I had known it was actually in 2.1 I would have upgraded sooner On Tuesday, September 13, 2016 at 1:29:53 PM UTC-4, Matt Martz wrote: > > Based on that issue, and the corresponding co

Re: [ansible-project] Does Ansible have to run as root? sudo and --become-user

2016-09-13 Thread Kai Stian Olstad
On 13. sep. 2016 18:41, Mike Schlottman wrote: I have just started looking into Ansible and have built a server on Centos 7. I generally don't run anything as root so I created an ansible account and group and chown -R ansible:ansible /etc/ansible. I assumed that this would be OK, but as I sta

[ansible-project] Ansible merge multiple files.

2016-09-13 Thread Eric Marquez
Hello, I have a number of templates that are generated by Ansible but I need them combined into a single file. Is there a way to do this without having to do a shell command "file1 >> newFile.txt" For example I have 4 files and I need to merge the content from these 4 source files to a singl

Re: [ansible-project] Ansible merge multiple files.

2016-09-13 Thread Brian Coca
tempalate can do this via includes, but you also have the assemble module. -- -- 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

Re: [ansible-project] Re: Not able ping instances using dynamic inventory

2016-09-13 Thread Brian Coca
run the script /etc/ansible/inventory/ec2.py directly and see what output you get. -- 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 an

RE: [ansible-project] Ansible merge multiple files.

2016-09-13 Thread Eric Marquez
Is there an example of how you might use includes with template? From: ansible-project@googlegroups.com [mailto:ansible-project@googlegroups.com] On Behalf Of Brian Coca Sent: Tuesday, September 13, 2016 3:53 PM To: ansible-project@googlegroups.com Subject: Re: [ansible-project] Ansible merge mul

Re: [ansible-project] Ansible merge multiple files.

2016-09-13 Thread Brian Coca
here are the jinja docs about it: http://jinja.pocoo.org/docs/dev/templates/#include -- 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] iosxr_config load config question

2016-09-13 Thread Peter Sprygada
Hi Radoslav, Can you post the output of ansible --version? One of two things is happening here: 1) you are not running Ansible from source (the src argument is being added in the upcoming 2.2 release) 2) you are running from source but the module cannot find the file "fabric.cfg". If you are ru

Re: [ansible-project] idea: allow group_vars/ and host_vars/ files to be organised in sub folders

2016-09-13 Thread Kai Stian Olstad
On 12.09.2016 15:15, 'Sean Cavanaugh' via Ansible Project wrote: In this thread though Dehaan said this should work-> I just tried this on 1.9.1 I have /group_vars/staging/staging.yml and /group_vars/staging/secrets.yml and it seems to me that it is not merging the files properly. But othe