[ansible-project] run_once not working to register value of curl

2020-04-10 Thread Nicola Contu
Hello, I am trying to get the latest version of few softwares and comparing it with a list of hosts with the current installed. Calling the github API is creating issues with the number of call due to the the list of hosts that is quite big. So I would like to register the latest versions in a

Re: [ansible-project] Re: Every SSH connection logs mux_client_read_packet: read header failed: Broken pipe

2020-04-10 Thread Mark Hansen
I tried taking a packet capture with Wireshark just to be double-sure that Ansible was reusing the same connection, and Ansible was. I ran wireshark, limited capture to "tcp.port == 22", and then went to Menu -> Statistics -> Conversations -> TCP, and I observe only one long-lived TCP SSH

[ansible-project] Re: Every SSH connection logs mux_client_read_packet: read header failed: Broken pipe

2020-04-10 Thread Mark Hansen
I'm also observing this problem too. ansible-playbook 2.9.5 config file = /Users/mark/projects/pis/ansible.cfg configured module search path = ['/Users/mark/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location =

[ansible-project] Re: Every SSH connection logs mux_client_read_packet: read header failed: Broken pipe

2020-04-10 Thread Mark Hansen
Oh, and here's my ansible.cfg > cat ansible.cfg [ssh_connection] pipelining = True # ssh_args = -C -o ControlMaster=auto -o ControlPersist=30m # https://github.com/ansible/ansible/issues/26359 [defaults] # Defaults to /usr/bin/python otherwise interpreter_python = /usr/bin/python3 #

Re: [ansible-project] Re: Every SSH connection logs mux_client_read_packet: read header failed: Broken pipe

2020-04-10 Thread Mark Hansen
I'm investigating a bit further, I see the SSH command that ansible is executing (look for the line starting with "SSH: EXEC", and I try running that in isolation: ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o

Re: [ansible-project] Abort playbook in case ping task failed

2020-04-10 Thread Kai Stian Olstad
On Tue, Apr 07, 2020 at 06:24:04AM +0200, Vladimir Botka wrote: > On Mon, 6 Apr 2020 14:10:18 -0700 (PDT) > דודו דודו wrote: > > > I'm checking ping on a few of my groups. I wish to abort the playbook if > > one of the IPs is not reachable > > > > - hosts: > > - postgres1 > > -

Re: [ansible-project] Ansible on CentOS 7 problem with "selinux" on a Cisco Wireless LAN Controller

2020-04-10 Thread Sebigeli
No idea ? 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 view this discussion on the web visit

[ansible-project] Jason_query on setup

2020-04-10 Thread Kiran Kumar
I am looking to find vm with 4 CPUs , Please suggest what i am doing wrong --- ## This playbook is for : - name: Play with Jason Query for learning it hosts: temp gather_facts: yes remote_user: root tasks: - name: Gather facts setup: register: vm_setup - name: Get

[ansible-project] Short output from playbook like ansible -o

2020-04-10 Thread Kiran Kumar
Please suggest how can get one liner o/p eg what i get with ansible temp -b -a uptime -o , in below playbook - hosts: all gather_facts: true tasks: - debug: var: ansible_all_ipv4_addresses -- You received this message because you are subscribed to the Google Groups "Ansible

[ansible-project] Powershell code in Ansible playbook returns non zero error code

2020-04-10 Thread Nasir Nasir
[image: awx-error.PNG] [image: code.PNG] Hi All, i have an issue respect to powershell code which i am using to delete file from windows machine using an Ansible code via AWX i have mongodb lookup value= 'C:/Users/abcd/abcd/','C:/abc/', code is delete the file in the folder but returning

Re: [ansible-project] Powershell code in Ansible playbook returns non zero error code

2020-04-10 Thread Dick Visser
Hi Nasir Sorry to hear this, it does sound like bad planning on your side. Please don't make that our problem, this is a best effort support list with no SLAs etc. On that note - you will significantly increase the chances of someone helping you if you post text instead of mostly unreadable

Re: [ansible-project] run_once not working to register value of curl

2020-04-10 Thread Nicola Contu
Hey Dick, I tried that but the subsequent play is not able to recognise those variables. *{"msg": "The task includes an option with an undefined variable. The error was: 'PHP_SITE_RESPONSE' is undefined* I changed the playbook like this : *- hosts:

Re: [ansible-project] run_once not working to register value of curl

2020-04-10 Thread Dick Visser
Add a new play to the top of the list that targets localhost. The use the registered vars in a subsequent play that targets all your hosts. On Fri, 10 Apr 2020 at 15:48, Nicola Contu wrote: > Hello, > I am trying to get the latest version of few softwares and comparing it > with a list of hosts

Re: [ansible-project] run_once not working to register value of curl

2020-04-10 Thread Kai Stian Olstad
On Fri, Apr 10, 2020 at 06:48:05AM -0700, Nicola Contu wrote: > Hello, > I am trying to get the latest version of few softwares and comparing it > with a list of hosts with the current installed. > > Calling the github API is creating issues with the number of call due to > the the list of

Re: [ansible-project] Ansible on CentOS 7 problem with "selinux" on a Cisco Wireless LAN Controller

2020-04-10 Thread Kai Stian Olstad
On Fri, Apr 10, 2020 at 02:15:11AM -0700, Sebigeli wrote: > No idea ? > Thanks Well, when you post your error message as an image you limit the number for people that can help. As an example, my mail client doesn't support images or HTML-mails. -- Kai Stian Olstad -- You received this

[ansible-project] Re: using vars_prompt in a vars file being addressed by include_vars

2020-04-10 Thread xxmlud gnu
Hello, I think "vars_prompt" can only be used in the main playbook. BR, El jueves, 9 de abril de 2020, 20:45:28 (UTC+2), Dave Zarei escribió: > > HI, > > Got a quick question, I'm trying to use include_vars in a main play which > addresses a vars file in which there is vars_prompt (i also

Re: [ansible-project] Ansible on CentOS 7 problem with "selinux" on a Cisco Wireless LAN Controller

2020-04-10 Thread Stefan Hornburg (Racke)
On 4/10/20 5:48 PM, Kai Stian Olstad wrote: > On Fri, Apr 10, 2020 at 02:15:11AM -0700, Sebigeli wrote: >> No idea ? >> Thanks > > Well, when you post your error message as an image you limit the number for > people that can help. > As an example, my mail client doesn't support images or

Re: [ansible-project] run_once not working to register value of curl

2020-04-10 Thread Dan Linder
So, from that output we know that the 'PHP_SITE_RESPONSE' variable is being set and we have the variable structure to look at. Your error from a few messages back just showed: {"msg": "The task includes an option with an undefined variable. The error was: 'PHP_SITE_RESPONSE' is undefined I

[ansible-project] Re: Powershell code in Ansible playbook returns non zero error code

2020-04-10 Thread David Foley
Have you Tested the Powershell Code on a local machine to make sure it's working ? You could: - Create the Powershell Script in Name.ps1 - Copy Name.ps1 to Temp - Run it and then Remove name.ps1 from Temp Folder In the past, I had issues with running Powershell Scripts using

Re: [ansible-project] Append data to json file using ansible modules

2020-04-10 Thread Dick Visser
It depends on your data. Please post your json and tell what you want to manipulate exactly. Lineinfile sounds fragile. You might have better results with from_json, combine, and to_json. On Fri, 10 Apr 2020 at 21:02, syam rhel wrote: > Hi All, > > Is it possible to update the data of json

Re: [ansible-project] run_once not working to register value of curl

2020-04-10 Thread Nicola Contu
[ncontu@cmd-config cmd]$ ansible-playbook playbooks/test.yml -e "variable_host=127.0.0.1" [DEPRECATION WARNING]: The TRANSFORM_INVALID_GROUP_CHARS settings is set to allow bad characters in group names by default, this will change, but still be user configurable on deprecation. This feature will

[ansible-project] Append data to json file using ansible modules

2020-04-10 Thread syam rhel
Hi All, Is it possible to update the data of json file using ansible modules. I tried on windows machine using win_lineinfile module but the required file is not updating. The line is updating at the end of the file. Can any one suggest the solution for editing fields in json file. Thank

Re: [ansible-project] run_once not working to register value of curl

2020-04-10 Thread Dan Linder
Hi Nicola, I'd take a bit step back and reduce your playbook to just a couple of tasks: ``` - hosts: "{{ variable_host }}" serial: 1 tasks: - name: "Get PHP version from site" register: PHP_SITE_RESPONSE uri: body_format: json method: GET

Re: [ansible-project] Append data to json file using ansible modules

2020-04-10 Thread vinoth kumar
You have a parameter insert before or insert after where you can regex and update your code. Let us know if it works. Or put your code and error to get it to work On Fri 10. Apr 2020 at 21:02, syam rhel wrote: > Hi All, > > Is it possible to update the data of json file using ansible modules. >