[ansible-project] Re: need help for XML to JSON Parsing Error with Ansible using Parse_xml

2022-07-07 Thread maulik patel
anyone here to help me out with this please ? thanks... On Thursday, July 7, 2022 at 6:57:27 PM UTC+5:30 maulik patel wrote: > hi , > > I was trying to parse a XML response to JSON using parse_xml from an AWS > VPN output, but I'm getting the below error. > I am able to parse data with > *"vpn_

Re: [ansible-project] manage docker via Ansible - question on the python docker library/package on the target

2022-07-07 Thread 'Felix Fontein' via Ansible Project
Hi, > > > The best alternative is usually to install it from system > > > packages. For example, on Ubuntu and Debian, there's the > > > python3-docker system package you can install. For other OSes > > > similar packages might exist. > > > > same same (python3-docker) on this rhel8 host. Will g

Re: [ansible-project] Ansible integration with LUMEN devices

2022-07-07 Thread Nico Kadel-Garcia
On Wed, Jul 6, 2022 at 12:30 AM Aditya Chauhan wrote: > > How can we integrate ansible with LUMEN devices for fetching top talkers > details by using commands. Is there any module or something? How can we > achieve this. here are some modules involving "lumen" there. which might be a place to s

Re: [ansible-project] manage docker via Ansible - question on the python docker library/package on the target

2022-07-07 Thread Nico Kadel-Garcia
On Thu, Jul 7, 2022 at 7:39 AM dulhaver via Ansible Project wrote: > > > The best alternative is usually to install it from system packages. For > > example, on Ubuntu and Debian, there's the python3-docker system > > package you can install. For other OSes similar packages might exist. > > same s

Re: [ansible-project] manage docker via Ansible - question on the python docker library/package on the target

2022-07-07 Thread Nico Kadel-Garcia
On Thu, Jul 7, 2022 at 6:59 AM 'Felix Fontein' via Ansible Project wrote: > > Hi, > > > I try to handle docker containers via Ansible and am getting this > > error: > > msg: 'Failed to import the required Python library (Docker SDK > > for Python: docker (Python >= 2.7) or docker-py (Python 2

Re: [ansible-project] what s the use of % set with ansible

2022-07-07 Thread gomz arvind
@abhijeet and @brian ..thanks for ur responses @abhijeet- I was trying to remove a nth element from the array..so I have tried with popup @brian : this is my understanding from ur tips..correct me if I am wrong {% set var =value %} should we consider var is used only once if we use %.? if w

Re: [ansible-project] what s the use of % set with ansible

2022-07-07 Thread Brian Coca
To further explain, {% set var =value %} will only have an effect within that template, that does not create/update ansible variables. So while it does 'work' , you should really only use it inside a full jinja2 template. -- -- Brian Coca -- You received this message because you are su

Re: [ansible-project] Meta module

2022-07-07 Thread Brian Coca
many actions do this, they normally have a note that states they 'bypass host loop', for example add_host, and group_by do the same thing. -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this g

[ansible-project] need help for XML to JSON Parsing Error with Ansible using Parse_xml

2022-07-07 Thread maulik patel
hi , I was trying to parse a XML response to JSON using parse_xml from an AWS VPN output, but I'm getting the below error. I am able to parse data with *"vpn_conn_facts.vpn_connections[0].customer_gateway_configuration"* but, it is when I apply the filter parse_xml, that the error arise. *-> E

Re: [ansible-project] manage docker via Ansible - question on the python docker library/package on the target

2022-07-07 Thread dulhaver via Ansible Project
> The best alternative is usually to install it from system packages. For > example, on Ubuntu and Debian, there's the python3-docker system > package you can install. For other OSes similar packages might exist. same same (python3-docker) on this rhel8 host. Will go for that then. thx for the wi

Re: [ansible-project] manage docker via Ansible - question on the python docker library/package on the target

2022-07-07 Thread 'Felix Fontein' via Ansible Project
Hi, > I try to handle docker containers via Ansible and am getting this > error: > msg: 'Failed to import the required Python library (Docker SDK > for Python: docker (Python >= 2.7) or docker-py (Python 2.6)) on > vm-51150-0191''s Python /usr/libexec/platform-python. Please read > module do

Re: [ansible-project] Unable to execute ansible playbook

2022-07-07 Thread Ashok Reddy
It works. Thanks Racke. On Thu, Jul 7, 2022 at 4:24 PM Stefan Hornburg (Racke) wrote: > On 07/07/2022 12:50, Ashok Reddy wrote: > > cat hosts > > > > [default] > > > > localhost > > > > ansible_user=cloud-user > > > > [default] > localhost ansible_user=cloud-user > > Regards > Racke >

Re: [ansible-project] Unable to execute ansible playbook

2022-07-07 Thread Stefan Hornburg (Racke)
On 07/07/2022 12:50, Ashok Reddy wrote: cat hosts [default] localhost ansible_user=cloud-user [default] localhost ansible_user=cloud-user Regards Racke odsec-test ~]# vi hosts [root@modsec-test ~]# ansible-playbook -i ./hosts modsec-compile.yml --private-key nonprod PLAY [

Re: [ansible-project] Unable to execute ansible playbook

2022-07-07 Thread Ashok Reddy
cat hosts [default] localhost ansible_user=cloud-user odsec-test ~]# vi hosts [root@modsec-test ~]# ansible-playbook -i ./hosts modsec-compile.yml --private-key nonprod PLAY [default]

Re: [ansible-project] Unable to execute ansible playbook

2022-07-07 Thread Stefan Hornburg (Racke)
On 07/07/2022 11:48, Ashok Reddy wrote: - hosts: default ansible_user: cloud-user become: yes become_method: sudo gather_facts: true Error: ERROR! 'ansible_user' is not a valid attribute for a Play Hello, the ansible_user needs to be set in the inventory. Regards Racke The e

Re: [ansible-project] Unable to execute ansible playbook

2022-07-07 Thread Ashok Reddy
- hosts: default ansible_user: cloud-user become: yes become_method: sudo gather_facts: true Error: ERROR! 'ansible_user' is not a valid attribute for a Play The error appears to be in '/root/modsec-compile.yml': line 2, column 3, but may be elsewhere in the file depending on the e

[ansible-project] manage docker via Ansible - question on the python docker library/package on the target

2022-07-07 Thread dulhaver via Ansible Project
hi everybody, I try to handle docker containers via Ansible and am getting this error: msg: 'Failed to import the required Python library (Docker SDK for Python: docker (Python >= 2.7) or docker-py (Python 2.6)) on vm-51150-0191''s Python /usr/libexec/platform-python. Please read mo

Re: [ansible-project] what s the use of % set with ansible

2022-07-07 Thread Abhijeet Kasurde
I am assuming you want to split a string and set the value of that to a variable, then no need to use jinja templates ``` --- - hosts: localhost gather_facts: no vars: name: "ab:hi:je:ee" tasks: - name: Print variable set_fact: my_var: "{{ (name.split(':') | default(''

Re: [ansible-project] what s the use of % set with ansible

2022-07-07 Thread gomz arvind
--- - name: Cisco NXOS hosts: all connection: network_cli gather_facts: false vars: - cmdlist: sh clock - ansible_python_interpreter: /usr/bin/python3 - ansible_network_os: nxos - project: tasks: - name: Execute command nxos_command: comma

Re: [ansible-project] Unable to execute ansible playbook

2022-07-07 Thread Stefan Hornburg (Racke)
On 07/07/2022 10:05, Ashok Reddy wrote: the same issue happens even I have provided with -K argument: You need to login as the cloud-user and use privilege escalation (https://docs.ansible.com/ansible/latest/user_guide/become.html) to execute the tasks as root user. ansible_user: cloud-user

Re: [ansible-project] Unable to execute ansible playbook

2022-07-07 Thread Ashok Reddy
the same issue happens even I have provided with -K argument: SSH password: PLAY [default] TASK [Gatherin

Re: [ansible-project] Unable to execute ansible playbook

2022-07-07 Thread Ashok Reddy
But My playbook is available with root user. I am able to log in with cloud-user and then with sudo privileges as root, I have implemented a play book. So that I can execute playbook with root privileges. On Thu, Jul 7, 2022 at 12:34 PM Abhijeet Kasurde wrote: > This might give you a clue - st

Re: [ansible-project] Unable to execute ansible playbook

2022-07-07 Thread Abhijeet Kasurde
This might give you a clue - stdout output: Please login as the user \"cloud-user\" rather than the user \"root\".\n\n" On Thu, Jul 7, 2022 at 12:14 PM Prady A wrote: > While executing the command provide -k option and provide the root > password or > Authenticate your localhost. > > > On Thu,