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 others said this was a problem.  I just don't think this is 
documented

well.  If its not supposed to work I guess it shouldn't work :(


According to the documentation it should work
https://docs.ansible.com/ansible/intro_inventory.html#splitting-out-host-and-group-specific-data

Quote from the page:
"As an advanced use-case, you can create directories named after your 
groups or hosts, and Ansible will read all the files in these 
directories. An example with the ‘raleigh’ group:


  /etc/ansible/group_vars/raleigh/db_settings
  /etc/ansible/group_vars/raleigh/cluster_settings

All hosts that are in the ‘raleigh’ group will have the variables 
defined in these files available to them. This can be very useful to 
keep your variables organized when a single file starts to be too big, 
or when you want to use Ansible Vault on a part of a group’s variables. 
Note that this only works on Ansible 1.4 or later."


--
Kai Stian Olstad

--
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/90953fe162eb21572eb7e453228d3cbd%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


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 running from
the latest commit on devel, we recently added a check that would alert you
if the file specified in src could not be found

On Sun, Sep 11, 2016 at 8:42 AM, Radoslav Mitov 
wrote:

> 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/rado/.ssh/z-id_rsa",
> "transport": "cli", "username": "rado"}, "src": "fabric.cfg",
> "ssh_keyfile": "/home/rado/.ssh/z-id_rsa", "username": "rado"},
> "module_name": "iosxr_config"}, "msg": "unsupported parameter for module:
> src"}
>
> below is the role:
> ---
> - name: transfer generated file to IOS
>   hosts: cisco
>   gather_facts: no
>   vars:
> cli:
>   host: "{{ ansible_ssh_host }}"
>   username: rado
>   transport: cli
>   ssh_keyfile: /home/rado/.ssh/z-id_rsa
>   tasks:
>   - name: load a config from disk and replace the current config
> iosxr_config:
>   src: "fabric.cfg"
>   update: replace
>   backup: no
>   provider: "{{ cli }}"
>
> Thanks in advance!
>
> --
> 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, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/a39e7229-bbb5-49ea-9ae0-36c515ba9a69%40googlegroups.
> com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAEkdrMgSQ%2BX%2BKkQDoyw2MdhJpKVexPU-8kd2pg01hhDYt_8GYA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACVha7cR-sSKijgWQ9N%2BLwCqxsHON9uLsHYf585AuOLrxq-JmQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 multiple files.

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-project+unsubscr...@googlegroups.com.
To post to this group, send email to 
ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACVha7esj9aHk7g6v8xDLzry%2BvWJxO3dvTxcRJ7%3DhdfCKbqZUA%40mail.gmail.com.
For more options, visit 
https://groups.google.com/d/optout.

-- 
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/BN6PR03MB2723929EA1790FF8B8A7E11FDDFE0%40BN6PR03MB2723.namprd03.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.


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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACVha7eC0A1W0W68%2BbqkYZF8iMS9gdqsA%2BpLjKGtdbe1oGbXiA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACVha7esj9aHk7g6v8xDLzry%2BvWJxO3dvTxcRJ7%3DhdfCKbqZUA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[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 single destination file.

File1 > dest.txt
File2 >> dest.txt
File3 >> dest.txt
File4 >> dest.txt

In my case these 4 files were generated by Ansible Templates.  Since I have a 
vars file that is a data dictionary it creates multiple files.  From these 
multiple files I need to merge them into a single file.  I looked at lineinfile 
but I'm not saving a single line  but 50 - 100 lines.
Is there a better way to do this other than using shell commands?

-- 
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/BN6PR03MB27230C3C7FF1C6E6CAD3BFE6DDFE0%40BN6PR03MB2723.namprd03.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.
<>

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 start experimenting with
commands, it does not seem to use sudo the way I had expected.


It's perfectly OK to create a user, Ansible work great with sudo.



As expected this fails because the ansible user does not have access to
read /etc/shadow.

-sh-4.2$ ansible localhost -a '/bin/cat /etc/shadow'
localhost | FAILED | rc=1 >>
/bin/cat: /etc/shadow: Permission denied

When I try -b and --become-user root, I get this.
-sh-4.2$ ansible localhost -a '/bin/cat /etc/shadow' -b --become-user root
localhost | FAILED | rc=0 >>
MODULE FAILURE


[snip]



Am I using --become-user incorrectly?


I would not say so. What you are missng is the sudo password.

The become user is default root, so you do not need to specify that.
And you are using -b for become.
But you must provide the sudo password if you don't have NOPASSWORD in 
sudoers.


So this should work for you:
ansible localhost -a 'cat /etc/shadow' -b --ask-sudo-pass

--
Kai Stian Olstad

--
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1f1aca0c-b0a1-cd44-467d-5c0978add752%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


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 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, Sep 13, 2016 at 12:23 PM, John Scancella  > wrote:
>
>> 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
>>   become: yes
>>   become_method: sudo
>>   tasks:
>> - file: name=/tmp/tempFile.txt state=touch
>>
>> - name: test loops are broken
>>   copy: remote_src=yes dest={{ item.dest }} src={{ item.src }}
>>   with_items:
>> - { dest: "/tmp/foo.txt", src: "/tmp/tempFile.txt" }
>> - { dest: "/tmp/bar.txt", src: "/tmp/tempFile.txt" }
>>
>> thanks
>> John
>>
>> -- 
>> 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-proje...@googlegroups.com .
>> To post to this group, send email to ansible...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/8e6f898d-ce72-4294-a13d-f032462b8e13%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Matt Martz
> @sivel
> sivel.net
>

-- 
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/13136c8c-630e-4152-942c-c8b2951a9e2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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, Sep 13, 2016 at 12:23 PM, John Scancella <
blacksmithforl...@gmail.com> wrote:

> 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
>   become: yes
>   become_method: sudo
>   tasks:
> - file: name=/tmp/tempFile.txt state=touch
>
> - name: test loops are broken
>   copy: remote_src=yes dest={{ item.dest }} src={{ item.src }}
>   with_items:
> - { dest: "/tmp/foo.txt", src: "/tmp/tempFile.txt" }
> - { dest: "/tmp/bar.txt", src: "/tmp/tempFile.txt" }
>
> thanks
> John
>
> --
> 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, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/8e6f898d-ce72-4294-a13d-f032462b8e13%40googlegroups.
> com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Matt Martz
@sivel
sivel.net

-- 
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v-9Xj6V%3DgLHac9aaCWRemB9sQzWOG9tpQZbV2wFgUMNPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 does this account for every action in those that do.


--
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...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACVha7cpzYLmrhZKq5V-RxxBJ-kDWNhp9ZTbrCTgv66LtEeC8w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 
"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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACVha7fqkusUyfLGVdDQe1Fuoh%3DnT%3DWR%3D_tehmDahnE-2Q4X%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACVha7dJc3yHReOv1CTvu3LiEcSztDFG0jVRo_t8sc-hu0h5-w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[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
  become: yes
  become_method: sudo
  tasks:
- file: name=/tmp/tempFile.txt state=touch

- name: test loops are broken
  copy: remote_src=yes dest={{ item.dest }} src={{ item.src }}
  with_items:
- { dest: "/tmp/foo.txt", src: "/tmp/tempFile.txt" }
- { dest: "/tmp/bar.txt", src: "/tmp/tempFile.txt" }

thanks
John

-- 
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8e6f898d-ce72-4294-a13d-f032462b8e13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


回复:[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 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 though.

On Tuesday, September 13, 2016 at 11:14:40 AM UTC+2, Mike Fennemore wrote: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.



 

 -- 
 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, send email to ansible-project@googlegroups.com.
 To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7eb4f242-dcd1-4f9a-8152-6a2f088775a8%40googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/tencent_51C23C5F4CCA6D82699D89F5%40qq.com.
For more options, visit https://groups.google.com/d/optout.


[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/rado/.ssh/z-id_rsa", 
"transport": "cli", "username": "rado"}, "src": "fabric.cfg", 
"ssh_keyfile": "/home/rado/.ssh/z-id_rsa", "username": "rado"}, 
"module_name": "iosxr_config"}, "msg": "unsupported parameter for module: 
src"}

below is the role:
---
- name: transfer generated file to IOS
  hosts: cisco
  gather_facts: no
  vars:
cli:
  host: "{{ ansible_ssh_host }}"
  username: rado
  transport: cli
  ssh_keyfile: /home/rado/.ssh/z-id_rsa
  tasks:
  - name: load a config from disk and replace the current config
iosxr_config:
  src: "fabric.cfg"
  update: replace
  backup: no
  provider: "{{ cli }}"

Thanks in advance!

-- 
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a39e7229-bbb5-49ea-9ae0-36c515ba9a69%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 point of grouping it into a 
block if I have to set those default filters on each task? It's just going 
back to being 4 separate tasks.

On Tuesday, August 30, 2016 at 1:27:45 PM UTC-7, ayush...@similarweb.com 
wrote:
>
> Hey all,
>
> Just trying to figure out how to fix the deprecation warnings (recently 
> updated to 2.1.1.0 from 1.7). I used to have the 4 individual tasks in the 
> block below (I left the commented out when statements from the original 1.7 
> tasks). I tried refactoring a couple of times, but with the current setup, 
> I still get "Skipping task due to undefined Error, in the future this will 
> be a fatal error.: 'project_config' is undefined." on all 4 tasks when 
> project_config is undefined. Shouldn't the block just skip the tasks? Is 
> there something I'm missing about how blocks are executed? Is there a 
> better way to rewrite this set of tasks?
>
> - block:
> - name: Install system dependencies for project
>   become: True
>   apt: pkg={{ item }} state=installed
>   with_items: " {{ project_config.apt|default([]) }}"
>   # when: project_config is defined and 'apt' in project_config
> 
> - name: Install pip dependencies for project from files
>   pip: requirements={{ full_project_root }}/project_config/{{ item }}
>virtualenv_command=virtualenv
>virtualenv={{ venvdir }}
>virtualenv_python={{ venv_python }}
>virtualenv_site_packages=no
>state=present
>   with_items: "{{ project_config.pip_files|default([]) }}"
>   # when: project_config is defined and 'pip_files' in project_config
>   environment: "{{ pip_internal }}"
>   
> - name: Install npm dependencies
>   npm: path="{{ full_project_root }}/project_config/{{ item }}"
>state=latest
>production={{ npm_production }}
>   with_items: "{{ project_config.npm_package_json_path|default([]) }}"
>   # when: project_config is defined and 'npm_package_json_path' in 
> project_config
> 
> - name: Run Django server setup commands
>   django_manage: command={{ item }}
>  app_path={{ django_manage_path }} 
>  virtualenv={{ venvdir }}
>  settings={{ app_module }}.settings.{{ env }}
>   with_items: "{{ project_config.django_commands|default([]) }}"
>   # when: project_config is defined and 'django_commands' in 
> project_config
>   when: project_config is defined
>
> Thanks.
>

-- 
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/57898800-d65d-444a-bb56-06df4646bb88%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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/role1/tasks/stop.yaml
- include: ../roles/common/tasks/{{ item }}
  with_items:
- c.yml
- d.yml
- e.yml
- include: ../roles/role1/tasks/start.yaml


So is it a correct way to approach such kind of requirement OR there is 
cleaner way to achieve this? 

- Sunny B

-- 
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a7245094-6c66-4c03-8754-130e37827996%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 addition of a verbosity check.
>
> https://github.com/ansible/ansible/commit/a56c0bc27b07356c3639c0ac39805d4e5dd91171?diff=unified
>
> Anyone know why this change was made?  The commit message doesn't really 
> make sense to me.  
> Or if there's a way to now set the verbosity to 3 via the config file? 
> Or a way to set the verbosity to 3 and not show the full ssh commands on 
> the manager system?
>
> I ask because we've got a requirement that any automated configuration 
> management system do at least basic logging on the target system so that 
> changes can be referenced locally.
>
> Thanks,
> Ed
>
> On Friday, July 15, 2016 at 7:59:06 PM UTC-4, Ed S wrote:
>>
>> Hello,
>>   I'm running ansible 2.1.0.0 and when running a playbook against a 
>> target system(machine B), there are no messages logged to syslog on the 
>> target machine(machine b) during the run.  Are there settings necessary to 
>> get the modules and options logged to syslog on the target system(machine 
>> b)?
>>
>> If I add log_path=/tmp/ansible.log I get a list of modules and options 
>> logged to that file on the manager system(machine A), but still nothing on 
>> the target machine (machine b).
>>
>> Thanks,
>> Ed
>>
>> My current setup looks like this:
>>
>> Machine A - Manager system.  OS is debian with Ansible 2.1 installed from 
>> packages.  This is where I'm running Ansible
>> Machine B - Target system.  OS is RedHat 7.  
>>
>> Ansible.cfg
>> $ cat ansible.cfg 
>> [defaults]
>> roles_path=roles/internal:roles/external
>> vault_password_file=vpass
>> nocows=1
>> ask_sudo_pass=True
>> ansible_managed = Ansible managed: {file}
>>
>> Inventory file
>> $ cat inventory/test 
>> [test]
>> machine-b
>>
>> Test Playbook
>> $ cat plays/test.yml 
>> ---
>> - name: Test
>>   hosts: all
>>   tasks:
>> - name: touch file
>>   file:
>> state: touch
>> path: /tmp/test_file
>>
>> Ansible Run
>> $ ansible-playbook -i inventory/test plays/test.yml 
>> SUDO password: 
>>
>> PLAY [Test] 
>> 
>>
>> TASK [setup] 
>> ***
>> ok: [machine-b]
>>
>> TASK [touch file] 
>> **
>> changed: [machine-b]
>>
>> PLAY RECAP 
>> *
>> machine-b  : ok=2changed=1unreachable=0   
>>  failed=0   
>>
>>
>> Machine B Rsyslog has the following rule added
>> *.* /var/log/everything
>>
>> Machine B has the following journald settings
>> [Journal]
>> ForwardToSyslog=yes
>> MaxLevelSyslog=debug
>>
>>

-- 
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d5166cc9-5de5-4b41-8051-15daa8e371eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 where this var declaration stands in the precedence list 
for ansible 2.0+. I'd like this to be stronger than site variables for 
instance, but less strong than inventory (group and host) variables.
By the way for site variables I mean variables defined somewhere and 
included at some point  in the playbook calling the role, with an 
include_vars (so playbook level, actually?)

Thanks!

-- 
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/92be8d08-dd6e-457e-9328-c9783f3d389d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 }}"
 state: present
 fstype: ext4
 - mount:
 name: "{{ instance.value.mount }}"
 src: "/dev/{{instance.value.volume }}/{{ instance.key }}"
 state: mounted
 fstype: ext4

Whenever I run this, the first mount works as expected (creating the line 
on /etc/fstab), however, the second mount fails with:
fatal: [brsptla0101]: FAILED! => {"changed": false, "failed": true, "msg": 
"Error mounting /u01/diebs01: /bin/mount: invalid option -- 'T'\nUsage: 
mount -V : print version\n   mount -h : 
print this help\n   mount: list mounted 
filesystems\n   mount -l : idem, including volume 
labels\nSo far the informational part. Next the mounting.\nThe command is 
`mount [-t fstype] something somewhere'.\nDetails found in /etc/fstab may 
be omitted.\n   mount -a [-t|-O] ... : mount all stuff from 
/etc/fstab\n   mount device : mount device at the known 
place\n   mount directory  : mount known device here\n   
mount -t type dev dir: ordinary mount command\nNote that one does not 
really mount a device, one mounts\na filesystem (of the given type) found 
on the device.\nOne can also mount an already visible directory tree 
elsewhere:\n   mount --bind olddir newdir\nor move a subtree:\n   
mount --move olddir newdir\nOne can change the type of mount containing the 
directory dir:\n   mount --make-shared dir\n   mount --make-slave 
dir\n   mount --make-private dir\n   mount --make-unbindable 
dir\nOne can change the type of all the mounts in a mount 
subtree\ncontaining the directory dir:\n   mount --make-rshared dir\n   
mount --make-rslave dir\n   mount --make-rprivate dir\n   mount 
--make-runbindable dir\nA device can be given by name, say /dev/hda1 or 
/dev/cdrom,\nor by label, using  -L label  or by uuid, using  -U uuid 
.\nOther options: [-nfFrsvw] [-o options] [-p passwdfd].\nFor many more 
details, say  man 8 mount .\n"}

I thinks it's passing -T instead of -t, how can I fix this?
The only workaround I found is to use the shell command to mount the 
filesystem

I'm using ansible 2.2.0

Thank you.

-- 
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c8478ea1-035d-40f0-a506-d1f7af4f3b7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 documented 
well.  If its not supposed to work I guess it shouldn't work :(

On Sunday, September 11, 2016 at 2:11:46 PM UTC-4, Dick Davies wrote:
>
> Are you sure that's the way things are supposed to work? 
>
> I'd have expected individual hosts to be under host_vars/leaf01 , not 
> nested under a group (remember, a host can be in multiple groups). 
>
> so your layout would be more: 
>
> . 
> ├── group_vars 
> │   ├── all 
> │   └── leaf 
> ├── host_vars 
> │   ├── leaf01 
> │   └── leaf02 
> └── hosts 
>
>
> On 10 September 2016 at 19:02, 'Sean Cavanaugh' via Ansible Project 
> > wrote: 
> > I am curious if there was follow-up to this.  I am seeing something 
> similar 
> > for a customer I am working on. 
> > 
> > If I put all my variables under group_vars/all (where all is a flat file 
> in 
> > yml syntax) it works fine. 
> > If I move one device out of group_vars/all to group_vars/leaf/leaf01 all 
> > devices work great.  (where leaf corresponds to a group within my 
> Ansible 
> > hosts file). 
> > As soon as I do group_vars/leaf/leaf01 and leaf02 it can't find leaf01 
> > anymore.  leaf02 will work but not leaf01.  (where leaf01 and leaf02 are 
> > hosts in my ansible hosts file both in the group leaf) 
> > 
> > Do they have to end with .yml?  Is this not how group_vars works?  Just 
> > trying to make folders to break up variables for simplification. 
> > (I am running on Ansible 2.1.1) 
> > 
> > On Saturday, August 8, 2015 at 4:59:32 PM UTC-4, Serge van Ginderachter 
> > wrote: 
> >> 
> >> 
> >> On 7 August 2015 at 20:17,  wrote: 
> >>> 
> >>> 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. 
> >>> 
> >>> I have an api variable in the staging file which doesnt exist in the 
> >>> secrets file. When I run the playbook it complains that the api 
> variable 
> >>> doesnt exist. If I either remove the secrets file or add the api 
> variable to 
> >>> the secrets file then it works. 
> >> 
> >> 
> >> 
> >> If that would be true it would be a bug, and you would need to present 
> us 
> >> a minimal example on how to reproduce it. 
> >> 
> >> That being said, I use this feature everywhere around and i know i 
> works. 
> >> It might be some corner case of course, which would only become clear 
> when 
> >> being able to reproduce it. 
> >> 
> >> Can you make a minimal example that reproduces this, and show us the 
> >> needed files? 
> >> 
> >> Thanks, 
> >> 
> >> 
> >> Serge 
> > 
> > -- 
> > 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-proje...@googlegroups.com . 
> > To post to this group, send email to ansible...@googlegroups.com 
> . 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/ansible-project/95184094-6d7f-41f7-94aa-8d16521025d8%40googlegroups.com.
>  
>
> > 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/66b7416b-d18c-4569-ad42-76b72149f8a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 seem to use sudo the way I had expected.

As expected this fails because the ansible user does not have access to 
read /etc/shadow.

-sh-4.2$ ansible localhost -a '/bin/cat /etc/shadow'
localhost | FAILED | rc=1 >>
/bin/cat: /etc/shadow: Permission denied

When I try -b and --become-user root, I get this.
-sh-4.2$ ansible localhost -a '/bin/cat /etc/shadow' -b --become-user root
localhost | FAILED | rc=0 >>
MODULE FAILURE


/var/log/secure shows the following.
Sep 13 11:39:43 ansible sudo: servacct_ansible : TTY=pts/3 ; 
PWD=/home/servacct_ansible ; USER=root ; COMMAND=/bin/sh -c echo 
BECOME-SUCCESS-jjadcdyvpoluzchkhvkophnzqvhoxrcz; LANG=en_US.UTF-8 
LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python 
/home/servacct_ansible/.ansible/tmp/ansible-tmp-1473784783.91-193737108086693/command;
 
rm -rf 
"/home/servacct_ansible/.ansible/tmp/ansible-tmp-1473784783.91-193737108086693/"
 
> /dev/null 2>&


Am I using --become-user incorrectly?


-- 
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5f03b650-496a-44f2-a798-7f0feb26d40a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 these ways:

All of those include a common misunderstanding: The curly braces tell
Ansible "start (and stop) Jinja parsing", they don't delimit variables.
Once you're parsing Jinja, you don't need to start again in the middle.

I think you want something like

  - debug: msg="value - {{values[key]['val1']}}"

"values" and "key" aren't quoted, becuase they're variables. "val1" is,
because it's a literal string.

ij> And also, can someone guide me to a good resource which can educate me
ij> with the advanced syntax and usage of both YAML and Jinja2 ? I am sick
ij> of this hit and trial but couldn't find a detailed resource either.

Others may have better ideas here, but I often use
http://docs.ansible.com/ansible/playbooks_filters.html and
http://jinja.pocoo.org/docs/dev/templates/ for Jinja help.

  -Josh (j...@care.com)

(apologies for the automatic corporate disclaimer that follows)

This email is intended for the person(s) to whom it is addressed and may 
contain information that is PRIVILEGED or CONFIDENTIAL. Any unauthorized use, 
distribution, copying, or disclosure by any person other than the addressee(s) 
is strictly prohibited. If you have received this email in error, please notify 
the sender immediately by return email and delete the message and any 
attachments from your system.

-- 
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/22488.1487.979609.87322%40gargle.gargle.HOWL.
For more options, visit https://groups.google.com/d/optout.


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 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACVha7d2JTprWE1BAS0W6emoPUXPfPRAz11oPoPrBy8S9qzPug%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 from any_erros_fatal?

According to
http://docs.ansible.com/ansible/playbooks_error_handling.html#aborting-the-play
that should be a viable solution.

Regards,
Benjamin
-- 
FSU Jena | JULIELab.de/Staff/Benjamin+Redling.html
vox: +49 3641 9 44323 | fax: +49 3641 9 44321

-- 
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/57D7FDA7.1000309%40uni-jena.de.
For more options, visit https://groups.google.com/d/optout.


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 schedule has slipped.  I'm going to proceed on the 
assumption that 2.1.2-final is much more immanent and integrate that at 
$WORK now.

Thanks

John

-- 
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/320a78d2-10cf-47a5-a777-0914e40da68d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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:*
* - 1.4.1*
* - 1.4.2*
*   key2:*
* val1: 2.1*
* val2:*
* - 2.2.1*
* val3:*
* - 2.3.1*
* val4:*
* - 2.4.1*

The values for first level of keys (key1,key2) will be provided to the 
playbook as variable 'key' and i am trying to use the dictionary values 
corresponding to the dictionary i get from this 'key'. But i am unable to 
reference this dict within the playbook. I have tried some of these ways:

 - debug: msg="value - {{values.{{key}}}.val1}"
   
 - debug: msg="value - {{values[{{key}}]}}"
   
 - debug: msg="value - {{values[{{key}}][val1]}}"

But nothing works. How can i refer to some keys in a dictionary via 
variables ?
And also, can someone guide me to a good resource which can educate me with 
the advanced syntax and usage of both YAML and Jinja2 ? I am sick of this 
hit and trial but couldn't find a detailed resource either.


-- 
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ddfc272d-cf03-42eb-b564-6bf5e322dc72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 though.

On Tuesday, September 13, 2016 at 11:14:40 AM UTC+2, Mike Fennemore wrote:
>
> 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.
>

-- 
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7eb4f242-dcd1-4f9a-8152-6a2f088775a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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.

-- 
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/534a28fd-d3f2-4d6b-9c72-b92dbd5a3485%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3a64f7949dce2823507fbc1417797275%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


[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=/{{ Directoryname }} ls -d SHR_4YOU-{{product}}-*
  register: shr4you_inst
  ignore_errors: True
  when: repertoire.stat.isdir is defined and repertoire.stat.isdir

How can I port this line on Windows ?   shell: chdir=/{{ Directoryname }} 
ls -d SHR_4YOU-{{product}}-*

Thanks for your help.
Regards,

-- 
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e70541bb-f74a-43bf-bb2d-e7ff58c2ee1c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.