[ansible-project] Which ansible.cfg value is the "ansible-playbook -T" flag overriding?

2019-02-18 Thread ibdg
Per my stackoverflow 
question: 
https://stackoverflow.com/questions/54757444/which-ansible-cfg-timeout-value-is-t-overriding-on-the-ansible-playbook-comma

The ansible-playbook documentation 
 says that -T 
will "override the connection timeout in seconds (default=10)".


In the /etc/ansible/ansible.cfg file, under the [persistent_connection] 
section, 
there's *connect_timeout* *(default 30 sec)* and *command_timeout* *(default 
10 sec)*.


The ansible-playbook documentation would suggest it's the *connect_timeout* 
being 
overridden, but the default value that page specifies doesn't match the 
*connect_timeout* default value, it matches the *command_timeout* default 
value.


So, does the -T flag on the ansible-playbook command override the 
*connect_timeout*, *command_timeout*, or some other timeout not related to 
either of those?

-- 
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/4e2699da-e9f2-4911-9ebb-2c1d9619e6ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Dropping Fedora rpms from https://releases.ansible.com/

2019-02-18 Thread Toshio Kuratomi
Hey all,

Recently we had a discussion internally about whether to build
upstream Ansible rpms on Fedora 29 using Python3 or Python2.  This
lead to a question about how useful the Fedora rpms Ansible releases
on https://releases.ansible.com/ are.  We found that for each of the
Fedora releases, the rpms are being downloaded 300-350 times a week
(including downloads that seem to simply be mirrors of all of the rpms
we've built).

By comparison, our builds for EPEL-7 are seeing about 8,800 downloads a week.

Given this, we're thinking that we should stop building rpms for
Fedora and instead encourage people to use the rpms provided by the
Fedora Project themselves (which will tend to be more responsive to
changes in Fedora's packaging ecosystem... for instance, they have
Ansible rpms on Fedora 29 which use Python3, the default python for
that version of the distro).

If anyone uses our rpms in preference to the Fedora rpms, could you
let us know that you do so and why you use them over the ones provided
by Fedora?  If we don't hear of a good reason to do so, we'll probably
stop building for Fedora in a release or two.

Thanks,
-Toshio

-- 
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/CAPrnkaQBcyYyTxwaBmpgatvU4NDge1c1CGyu%3DEJuTpY%2B-Tvoeg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Having problems with a variable in vars_files

2019-02-18 Thread Sudarshan V
Have a look at
https://docs.ansible.com/ansible/latest/modules/include_vars_module.html


Cheers,
Sudarshan
0423356179


On Tue, Feb 19, 2019 at 9:39 AM Sudarshan V 
wrote:

> Ok, it is unclear what you are trying to accomplish.
> try import_vars
>
>
>
> Cheers,
> Sudarshan
> 0423356179
>
>
> On Mon, Feb 18, 2019 at 11:47 PM Brian O'Mahony 
> wrote:
>
>> I had tried that previous, and it is the same issue.
>>
>> --
>> 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/8b94c0e2-862f-43b4-b604-d589b1ac224d%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/CAGVXuK_6oXUeGihATMT%3DRzsDTZM%2B9zKsFbe-sYW3%3DE6FDNZWNQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Having problems with a variable in vars_files

2019-02-18 Thread Sudarshan V
Ok, it is unclear what you are trying to accomplish.
try import_vars



Cheers,
Sudarshan
0423356179


On Mon, Feb 18, 2019 at 11:47 PM Brian O'Mahony  wrote:

> I had tried that previous, and it is the same issue.
>
> --
> 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/8b94c0e2-862f-43b4-b604-d589b1ac224d%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/CAGVXuK9C2hvUAu74-wB_TjbhJ5%2Bqw-QfbWA6wRhKjEGJVe6kNg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: WinRM timeout for VMWare Tools Install

2019-02-18 Thread Jordan Borean
The psrp connection plugin in Ansible 2.8 adds a reconnection_retries and 
reconnection_backoff option that allows you to retry a connection x amount 
of times on a ReadTimeout 
https://docs.ansible.com/ansible/devel/plugins/connection/psrp.html. You 
could try that out and see how it goes.

The docs jhawkesworth linked to showed you that it is possible possible to 
delay the reboot, you should be doing that then running win_reboot after 
installing the tools so Ansible handles the reboot for you.

Thanks

Jordan

-- 
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/803e101b-1ce1-4266-b0c1-14a66df7c7d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: WinRM timeout for VMWare Tools Install

2019-02-18 Thread Seth Daemen
Did someone find a solutions for the time-out?

Op maandag 8 augustus 2016 16:56:17 UTC+2 schreef Matt Betts:
>
> Unfortunately the only switches I could find with VMWare tools was to 
> exclude modules entirely, not to postpone a delayed install until reboot. 
> I'm just going to keep VMware tools on my templates along with the Windows 
> Update until the async feature becomes available for Windows.
>
> Regards,
>
> Matt
>
> On Monday, August 1, 2016 at 4:06:48 PM UTC-4, Matt Davis wrote:
>>
>> Ansible 2.2 is scheduled to ship with async support for Windows (I'm 
>> putting the finishing touches on it now), which would be the right solution 
>> to this if you're unable to otherwise defer the NIC bounce. 
>>
>> -Matt
>>
>> On Friday, July 29, 2016 at 4:10:03 PM UTC-7, Matt Betts wrote:
>>>
>>> I've got a basic task to install VMWare tools on a Windows VM and when 
>>> it installs it looks to cause a temporary network disconnection whilst it 
>>> updates the NIC drivers. During this time WinRM looks to be timing out and 
>>> throwing an error. VMWare tools is successfully installing though. Is 
>>> anyone else using Ansible to install VMWare tools on Windows?
>>>
>>> Traceback (most recent call last):
>>>   File 
>>> "/usr/lib/python2.7/site-packages/ansible-2.2.0-py2.7.egg/ansible/plugins/connection/winrm.py",
>>>  
>>> line 270, in exec_command
>>> result = self._winrm_exec(cmd_parts[0], cmd_parts[1:], 
>>> from_exec=True)
>>>   File 
>>> "/usr/lib/python2.7/site-packages/ansible-2.2.0-py2.7.egg/ansible/plugins/connection/winrm.py",
>>>  
>>> line 215, in _winrm_exec
>>> response = Response(self.protocol.get_command_output(self.shell_id, 
>>> command_id))
>>>   File "/usr/lib/python2.7/site-packages/winrm/protocol.py", line 333, 
>>> in get_command_output
>>> self._raw_get_command_output(shell_id, command_id)
>>>   File "/usr/lib/python2.7/site-packages/winrm/protocol.py", line 352, 
>>> in _raw_get_command_output
>>> res = self.send_message(xmltodict.unparse(req))
>>>   File "/usr/lib/python2.7/site-packages/winrm/protocol.py", line 207, 
>>> in send_message
>>> return self.transport.send_message(message)
>>>   File "/usr/lib/python2.7/site-packages/winrm/transport.py", line 173, 
>>> in send_message
>>> response = self.session.send(prepared_request, 
>>> timeout=self.read_timeout_sec)
>>>   File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 
>>> 585, in send
>>> r = adapter.send(request, **kwargs)
>>>   File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 
>>> 479, in send
>>> raise ReadTimeout(e, request=request)
>>> ReadTimeout: HTTPSConnectionPool(host='LABSTC2WINVT675.labs.corp', 
>>> port=5986): Read timed out. (read timeout=30)
>>> fatal: [LABSTC2WINVT675.labs.corp]: UNREACHABLE! => {"changed": false, 
>>> "msg": "failed to exec cmd PowerShell -NoProfile -NonInteractive 
>>> -ExecutionPolicy Unrestricted -EncodedCommand 
>>> UwBlAHQALQBTAHQAcgBpAGMAdABNAG8AZABlACAALQBWAGUAcgBzAGkAbwBuACAATABhAHQAZQBzAHQACgBUAHIAeQAKAHsACgAmACAAJwBDADoAXABVAHMAZQByAHMAXABhAF8AdQBzAGUAcgBcAEEAcABwAEQAYQB0AGEAXABMAG8AYwBhAGwAXABUAGUAbQBwAFwAYQBuAHMAaQBiAGwAZQAtAHQAbQBwAC0AMQA0ADYAOQA4ADMAMwA1ADQANAAuADAAMQAtADIANgA0ADEANAA4ADEAOQAwADQAOAAzADIAOABcAHcAaQBuAF8AcABhAGMAawBhAGcAZQAuAHAAcwAxACcACgB9AAoAQwBhAHQAYwBoAAoAewAKACQAXwBvAGIAagAgAD0AIABAAHsAIABmAGEAaQBsAGUAZAAgAD0AIAAkAHQAcgB1AGUAIAB9AAoASQBmACAAKAAkAF8ALgBFAHgAYwBlAHAAdABpAG8AbgAuAEcAZQB0AFQAeQBwAGUAKQAKAHsACgAkAF8AbwBiAGoALgBBAGQAZAAoACcAbQBzAGcAJwAsACAAJABfAC4ARQB4AGMAZQBwAHQAaQBvAG4ALgBNAGUAcwBzAGEAZwBlACkACgB9AAoARQBsAHMAZQAKAHsACgAkAF8AbwBiAGoALgBBAGQAZAAoACcAbQBzAGcAJwAsACAAJABfAC4AVABvAFMAdAByAGkAbgBnACgAKQApAAoAfQAKAEkAZgAgACgAJABfAC4ASQBuAHYAbwBjAGEAdABpAG8AbgBJAG4AZgBvAC4AUABvAHMAaQB0AGkAbwBuAE0AZQBzAHMAYQBnAGUAKQAKAHsACgAkAF8AbwBiAGoALgBBAGQAZAAoACcAZQB4AGMAZQBwAHQAaQBvAG4AJwAsACAAJABfAC4ASQBuAHYAbwBjAGEAdABpAG8AbgBJAG4AZgBvAC4AUABvAHMAaQB0AGkAbwBuAE0AZQBzAHMAYQBnAGUAKQAKAH0ACgBFAGwAcwBlAEkAZgAgACgAJABfAC4AUwBjAHIAaQBwAHQAUwB0AGEAYwBrAFQAcgBhAGMAZQApAAoAewAKACQAXwBvAGIAagAuAEEAZABkACgAJwBlAHgAYwBlAHAAdABpAG8AbgAnACwAIAAkAF8ALgBTAGMAcgBpAHAAdABTAHQAYQBjAGsAVAByAGEAYwBlACkACgB9AAoAVAByAHkACgB7AAoAJABfAG8AYgBqAC4AQQBkAGQAKAAnAGUAcgByAG8AcgBfAHIAZQBjAG8AcgBkACcALAAgACgAJABfACAAfAAgAEMAbwBuAHYAZQByAHQAVABvAC0ASgBzAG8AbgAgAHwAIABDAG8AbgB2AGUAcgB0AEYAcgBvAG0ALQBKAHMAbwBuACkAKQAKAH0ACgBDAGEAdABjAGgACgB7AAoAfQAKAEUAYwBoAG8AIAAkAF8AbwBiAGoAIAB8ACAAQwBvAG4AdgBlAHIAdABUAG8ALQBKAHMAbwBuACAALQBDAG8AbQBwAHIAZQBzAHMAIAAtAEQAZQBwAHQAaAAgADkAOQAKAEUAeABpAHQAIAAxAAoAfQAKAEYAaQBuAGEAbABsAHkAIAB7ACAAUgBlAG0AbwB2AGUALQBJAHQAZQBtACAAIgBDADoAXABVAHMAZQByAHMAXABhAF8AdQBzAGUAcgBcAEEAcABwAEQAYQB0AGEAXABMAG8AYwBhAGwAXABUAGUAbQBwAFwAYQBuAHMAaQBiAGwAZQAtAHQAbQBwAC0AMQA0ADYAOQA4ADMAMwA1ADQANAAuADAAMQAtADIANgA0ADEANAA4ADEAOQAwADQAOAAzADIAOAAiACAALQBGAG8AcgBjAGUAIAAtAFIAZQBjAHUAcgBzAGUAIAAtAEUAcgByAG8AcgBBAGMAdABpAG8AbgAgAFMAaQBsAGUAbgB0AGwAeQBDAG8AbgB0AGkAbgB1AGUAIAB9AA==",
>>>  
>>> "unreachable": true}
>>>
>>>

-- 
You 

[ansible-project] Re: Export debug msg to a file

2019-02-18 Thread Mike Klebolt
The stat module does not have a return key of stdout_lines.  For a list of 
data that is returned from the stat module please reference this page here 

.

On Monday, February 18, 2019 at 2:58:11 AM UTC-6, Adelmo Silva wrote:
>
> Good Morning
> I need to send to a text file a message that appears in debug msg after a 
> check if a directory exists. Follow Playbook below. But it is giving error 
> in the recording of the file.
>
> This is my Playbook
>
> hosts: teste
> become: yes
> become_user: root
> become_method: sudo
> gather_facts: yes
>
> tasks:
>
> * name: Verificando Diretórios
>   stat:
>   path: /etc/teste_path/
>   register: path
> * debug:
>   msg: "Diretório Ok"
>   when: path.stat.isdir is defined and path.stat.isdir
> * debug:
>   msg: "Diretório Não existe"
>   when: path.stat.exists == False
> * debug: var=path.stdout_lines
> * name: Gravando Valores
>   local_action: lineinfile path=/root/find_path.txt 
> line={{path.stdout_lines}}; create=yes
>
>
> And results with errors:
>
> ASK [Gravando Valores] 
> *
> fatal: [10.0.10.117]: FAILED! => {"msg": "The task includes an option with 
> an undefined variable. The error was: 'dict object' has no attribute 
> 'stdout_lines'\n\nThe error appears to have been in 
> '/root/Ansible/Playbooks/find_path.yaml': line 24, column 5, but may\nbe 
> elsewhere in the file depending on the exact syntax problem.\n\nThe 
> offending line appears to be:\n\n\n - name: Gravando Valores\n ^ 
> here\n\nexception type:  'ansible.errors.AnsibleUndefinedVariable'>\nexception: 'dict object' has no 
> attribute 'stdout_lines'"}
> fatal: [10.0.10.122]: FAILED! => {"msg": "The task includes an option with 
> an undefined variable. The error was: 'dict object' has no attribute 
> 'stdout_lines'\n\nThe error appears to have been in 
> '/root/Ansible/Playbooks/find_path.yaml': line 24, column 5, but may\nbe 
> elsewhere in the file depending on the exact syntax problem.\n\nThe 
> offending line appears to be:\n\n\n - name: Gravando Valores\n ^ 
> here\n\nexception type:  'ansible.errors.AnsibleUndefinedVariable'>\nexception: 'dict object' has no 
> attribute 'stdout_lines'"}
> to retry, use: --limit @/root/Ansible/Playbooks/find_path.retry
>
>
>
> Thansk for your attention.
>
>
>
>

-- 
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/9a5316e9-c172-4ccb-b0bb-30b7e1a4f4fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Execute eval from shell module to set up environment variables

2019-02-18 Thread Adrian Sebastian Dutu
You need to put those export commands in the shell initialization files. 
Running export will set it just for the current session, which will close 
when the playbook ends.

-- 
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/add0e635-9146-46cd-bd45-fe4dae29bd00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Execute eval from shell module to set up environment variables

2019-02-18 Thread Adrian Sebastian Dutu
You need to put those export commands in the shell initialization files.
Running export will set it just for the current session, which will close
when the playbook ends.

On Sat, Feb 16, 2019 at 10:12 PM Захари Палазов 
wrote:

> Is it possible to execute eval command from a shell module to set up
> environment variables ?
>
> This is a snippet from a playbook which tries to set up environment
> variables by executing eval command
>
> eval $(docker-machine env DEV-MACHINE)
>
>
> This is the result of the eval command
> export DOCKER_TLS_VERIFY="1"
> export DOCKER_HOST="tcp://192.168.99.100:2376"
> export DOCKER_CERT_PATH="/home/user/.docker/machine/machines/DEV-MACHINE"
> export DOCKER_MACHINE_NAME="DEV-MACHINE"
>
>
>
> When this is executed from an ansible playbook environment variables are
> not set
>
>
> Best Regards to the team !
>
> --
> 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/8d11195b-fb01-4e94-964b-dfc212a77fed%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/CAHd1FN5PRNK1ogTGEEiu2baLt0RjOnc%2BSxqmpEoSP8wr5ZJhbA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Having problems with a variable in vars_files

2019-02-18 Thread Brian O'Mahony
I had tried that previous, and it is the same issue.

-- 
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/8b94c0e2-862f-43b4-b604-d589b1ac224d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] apt_key very slow on some keys?

2019-02-18 Thread Dick Visser
On Sat, 16 Feb 2019 at 19:11, 'Georg Großmann' via Ansible Project
 wrote:
>
> I think I can confirm now, that it is a problem with the IPv6 adress.
> I just used the proposal from 
> https://stackoverflow.com/questions/31519567/disable-ipv6-for-python-script 
> and changed /etc/gai.conf.
> Python now connects to "99.84.92.59" instead of the IPv6 adress 
> "2600:9000:200d:a000:3:db06:4200:93a1".
>
> The Playbook took on the virtualbox ubuntu server with this setting around 3 
> seconds.

Although this make things work, there still is something off in your
network configuration, as the OS for some reason thinks it has IPv6
connectivity, tries to use that, and then fails.
On a vanilla Bionic64 VM with working IPv6 this works instantly, so
the general IPv6 connectivity of download.docker.com looks to be fine.


-- 
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

-- 
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/CAL8fbwOH9fvGwWbSwghSRRk1_4jJzVZaXKXsN5KT44C31FV_CQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Check if test server configuration is same as prod server

2019-02-18 Thread Sudheer Satyanarayana



On 18/02/19 2:23 PM, Yacine Mourchid wrote:
This Speadsheet gets populated manually and these OK/KO values are a 
simply excel formule to compare both values.
You both comfirm that Ansible is the best way to maintain sure control 
of configurations and comparison of both environnement.


Do you know a good tutorial to set up this system ?


I'd start with the official documentation. Learn some basic Ansible 
concepts like inventory and start with template module. If you have any 
specific questions, ask here.


-

Sudheer S

--
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/212b25dd-4606-a2cd-8328-6f06a369d700%40techchorus.net.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How to handle case when dynamic inventory initially returns empty host list?

2019-02-18 Thread Keif Gwinn
Perhaps add a static inventory item alongside the dynamic so the scripts
can run against ansible localhost to create the remote inventory?

https://www.linuxtechi.com/manage-ansible-static-and-dynamic-host-inventory/
http://allandenot.com/devops/2015/01/16/ansible-with-multiple-inventory-files.html

On Sat, 16 Feb 2019 at 15:24, Andrei Pashkin 
wrote:

> Let's suppose I have a custom dynamic inventory fetches instances from EC2
> and makes an inventory from them and then if certain required instances do
> not exist they are created in the playbook and then inventory is refreshed
> using "meta: refresh_inventory" task.
> My problem is that when initial inventory is empty (because there is no
> instances at all) - Ansible just stops.
>
> I wonder - is there a recommended idiom to solve such problem?
>
> --
> 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/575e8af7-5a18-44a5-9717-5ee6b62b8216%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Keif Gwinn

-- 
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/CAMTXzjXLtru%2Bi30H_GgvNj4NSqn8KGnSf6GPrmrFPHGDVJF2aQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Export debug msg to a file

2019-02-18 Thread Adelmo Silva
Good Morning
I need to send to a text file a message that appears in debug msg after a 
check if a directory exists. Follow Playbook below. But it is giving error 
in the recording of the file.

This is my Playbook

hosts: teste
become: yes
become_user: root
become_method: sudo
gather_facts: yes

tasks:

* name: Verificando Diretórios
  stat:
  path: /etc/teste_path/
  register: path
* debug:
  msg: "Diretório Ok"
  when: path.stat.isdir is defined and path.stat.isdir
* debug:
  msg: "Diretório Não existe"
  when: path.stat.exists == False
* debug: var=path.stdout_lines
* name: Gravando Valores
  local_action: lineinfile path=/root/find_path.txt 
line={{path.stdout_lines}}; create=yes


And results with errors:

ASK [Gravando Valores] 
*
fatal: [10.0.10.117]: FAILED! => {"msg": "The task includes an option with 
an undefined variable. The error was: 'dict object' has no attribute 
'stdout_lines'\n\nThe error appears to have been in 
'/root/Ansible/Playbooks/find_path.yaml': line 24, column 5, but may\nbe 
elsewhere in the file depending on the exact syntax problem.\n\nThe 
offending line appears to be:\n\n\n - name: Gravando Valores\n ^ 
here\n\nexception type: \nexception: 'dict object' has no 
attribute 'stdout_lines'"}
fatal: [10.0.10.122]: FAILED! => {"msg": "The task includes an option with 
an undefined variable. The error was: 'dict object' has no attribute 
'stdout_lines'\n\nThe error appears to have been in 
'/root/Ansible/Playbooks/find_path.yaml': line 24, column 5, but may\nbe 
elsewhere in the file depending on the exact syntax problem.\n\nThe 
offending line appears to be:\n\n\n - name: Gravando Valores\n ^ 
here\n\nexception type: \nexception: 'dict object' has no 
attribute 'stdout_lines'"}
to retry, use: --limit @/root/Ansible/Playbooks/find_path.retry



Thansk for your attention.



-- 
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/e4c0be89-ed93-4b75-ba74-85fd479c1403%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Check if test server configuration is same as prod server

2019-02-18 Thread Yacine Mourchid
This Speadsheet gets populated manually and these OK/KO values are a simply 
excel formule to compare both values.
You both comfirm that Ansible is the best way to maintain sure control of 
configurations and comparison of both environnement.

Do you know a good tutorial to set up this system ?

Le vendredi 15 février 2019 23:18:39 UTC+1, Dick Visser a écrit :
>
> How does this spreadsheet gets populated?
> I.e. where do these OK and KO values come from?
>
> It looks like a mixture of desired state and actual state - but in a 
> spreadsheet?
>
> In any case the advice form the previous poster sounds like a good plan. 
> Just have one source of truth and be done with it. 
> Regarding the use of a spreadsheet, that is possible but I wonder what 
> benefit that gives. For sure it’s more difficult to keep that in version 
> control. 
>
> Dick
>
> On Fri, 15 Feb 2019 at 14:32, Yacine Mourchid  > wrote:
>
>> Thank for reply.
>>
>> To explain you the context. Currently we have an excel file when we put 
>> ALL configuration of both server (prod and test).
>> Here an example of parameters we compare for an apache server :
>>
>> [image: apache_dmz.PNG]
>>
>>
>> [image: me_dmz.PNG]
>>
>>
>> Le vendredi 15 février 2019 12:10:21 UTC+1, Sudheer S a écrit :
>>>
>>>
>>> On 15/02/19 4:28 PM, Yacine Mourchid wrote:
>>>
>>>
>>> I'm a beginner with Ansible.
>>> I wanna know how to check if configuration of test server and prod are 
>>> same or if there is a difference.
>>> And if it's possible, how to know what is the difference between them.
>>>
>>> I've several server to check.
>>>
>>> You have to provide more details than the abstract requirement.
>>>
>>> What configuration do you want to check exactly? Is the configuration 
>>> stored in some file, database, etc? 
>>>
>>> Looks like you might want to run a diff against two configuration files. 
>>>
>>> Having said that, you might want to consider this:
>>>
>>> Use Ansible to generate configuration and deploy to the target servers. 
>>> Manage the differences of environments(prod and test) in inventories. That 
>>> way you don't have to compare the configuration manually. 
>>> -- 
>>>
>>> Sudheer Satyanarayana
>>> IT Consultant 
>>>
>>> -- 
>> 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/689da2be-d69e-4297-bd58-d602adba97b1%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> -- 
> Sent from a mobile device - please excuse the brevity, spelling and 
> punctuation.
>

-- 
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/7da44407-f0f5-4e7c-b648-d4517e4a9917%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.