Re: [ansible-project] Re: Need to add A record and PRT recored in Cisco switches

2020-07-15 Thread Srinivas Naram
Hello Can you elaborate your issue and explain the steps taken so far. On Wed, Jul 15, 2020 at 2:21 PM Balayuvaraj Magudapathi < bala08yuva...@gmail.com> wrote: > Hi, > > Can any help on this > > > > On Monday, 13 July 2020 16:48:40 UTC+5:30, Balayuvaraj Magudapathi wrote: >> >> Hey, >> >> In

Re: [ansible-project] ansible check and diff mode not working

2020-07-15 Thread Srinivas Naram
Hello Shyam It is how the output is displayed. In your output updates are showing the difference in running config and your cfg file. "updates": [ "configure ntp server add x.x.x.x" ], I don't see any issue with the output. Did you try changing the ntp setting on the device

Re: [ansible-project] Need help with registered variable

2020-07-10 Thread Srinivas Naram
Try by removing quotes result[results][0].content.data On Fri, Jul 10, 2020 at 8:04 PM Rahul Kumar wrote: > Thanks Abhijeet ! I tried even result[‘results’][0].content.data but still > it complains results is not dict attribute ! > > On Fri, 10 Jul 2020 at 5:32 PM, Abhijeet Kasurde > wrote:

Re: [ansible-project] Re: ansible debug troubleshooting - script failing

2020-07-09 Thread Srinivas Naram
https://docs.ansible.com/ansible/latest/user_guide/connection_details.html On Thu, Jul 9, 2020 at 8:36 AM stack flow wrote: > Thx. I was able to ssh from command line so this isn't network issue. is > it because of python? > > TASK [show hostname] >

Re: [ansible-project] Ansible Command is not completing in playbook

2020-07-08 Thread Srinivas Naram
What errors are you seeing when playbook exits ? I presume that you are seeing a timeout error. This is because tcpdump is taking too long to fill the file. following link might help - https://docs.ansible.com/ansible/latest/network/user_guide/network_debug_troubleshooting.html#timeout-issues

Re: [ansible-project] cisco ios connect ssh error

2020-07-07 Thread Srinivas Naram
"provider": null, > > "ssh_keyfile": null, > > "timeout": null, > > "username": null > > } > > }, > > "msg&

Re: [ansible-project] cisco ios connect ssh error

2020-07-07 Thread Srinivas Naram
Are you able to connect to Cisco Switch from Ansible server via ssh ? The error says 'Connection Error'. On Tue, Jul 7, 2020 at 1:03 PM Sandy Hung wrote: > I connect cisco switch run playbook show error msg > please help thanks. > fatal: [tpesw-01]: FAILED! => { > "ansible_facts": {}, >

Re: [ansible-project] How to split value from list

2020-07-07 Thread Srinivas Naram
. JENISHA wrote: >> >>> In my case cut doesn't work. I m searching for a particular user from a >>> password. >>> $ grep anil /etc/passwd >>> >>> >>> Best Regards >>> Jenisha T >>> Whatsapp: +91 07598087866 <+91%2075980%20878

Re: [ansible-project] How to split value from list

2020-07-06 Thread Srinivas Naram
c/passwd >> >> >> Best Regards >> Jenisha T >> Whatsapp: +91 07598087866 >> >> >> >> >> >> On Mon, 6 Jul 2020 at 19:50, Stefan Hornburg (Racke) >> wrote: >> >>> On 7/6/20 3:32 PM, Srinivas Naram w

Re: [ansible-project] How to split value from list

2020-07-06 Thread Srinivas Naram
Hello Jenisha, Assuming that you are getting this value from /etc/passwd., try to change you command tail -1 /etc/passwd | awk '{split($0,a,":"); print a[1]}' On Mon, Jul 6, 2020 at 6:35 PM Dick Visser wrote: > you should either use set_fact, or register. Both doesn't make sense. > > On Mon,

Re: [ansible-project] Ansible not accepting When condition

2020-07-02 Thread Srinivas Naram
when is indented too much. Put it at the level where module name is mentioned. --- - name: using multiple conditions gather_facts: yes hosts: localhost connection: local tasks: - package: name: httpd state: installed when: - ansible_distribution ==

Re: [ansible-project] How to structure variables to distinguish different environments

2020-07-02 Thread Srinivas Naram
There could be some distinction between both the environments. Can you use gather_facts and get the differentiating value ? if you are able to get it using gather_facts, you can use set_facts Example set_facts: nfs_server: xyx when: ansible_distribution= 'CentOS' set_fact: nfs_server:

Re: [ansible-project] Regular Expression in ANSIBLE

2020-07-02 Thread Srinivas Naram
Not sure how you are initiating your playbooks. Here is what I did. I initiated my playbooks from a shell script and parsed the output in the script. On Thu, Jul 2, 2020 at 2:03 PM Jenisha T wrote: > > It's present in a remote server where the playbook is executed. I m facing > the problem

Re: [ansible-project] Regular Expression in ANSIBLE

2020-07-02 Thread Srinivas Naram
Hello - is this log file located in the server where Ansible is installed or remote server ? On Thu, Jul 2, 2020 at 5:25 AM Jenisha T wrote: > Hi > I have output from log file as below. I need to extract the string shown > in bold. > > Communication Diagnostic Report > >

Re: [ansible-project] Re: string not recognised in groups_vars/all

2020-06-30 Thread Srinivas Naram
Check out the syntax of 'all' file. I feel the indentation is not right. On Tue, Jun 30, 2020 at 5:29 PM Johana Galarza Monta wrote: > but that doesnt't respond to my answer on why this works when it is in the > playbook... and not when it is in groups-vars > > On Tuesday, 30 June 2020 12:28:56

Re: [ansible-project] Accessing Network Devices via Jump Hosts

2020-06-12 Thread Srinivas Naram
I have a similar question. In one of the environment, Application server (in which ansible is installed) is located in Green network and actual network devices are located in Red Network. Connection from Green network to Red Network is only by a VPN connection. Is there a possibility in Ansible to

Re: [ansible-project] Sending ansible output to python function

2020-06-11 Thread Srinivas Naram
Did you try to initiate Ansible playbook from Python code and capture Ansible output directly in the Python code ? You can use os module for it. Try using os.system('ansible-playbook wrote: > Hello, > > I have posted the following at >

Re: [ansible-project] Help with ios_command Module

2020-04-22 Thread Srinivas Naram
You can use ignore_errors=True On Wed, Apr 22, 2020 at 6:48 PM Omar Hegazy wrote: > Hello, i have 2 switches. I wanted to run a command (show arp) and check a > specific output if exist or not on both. Then, i wanted to run a command > (show arp) and display the output. > > The problem is that

Re: [ansible-project] Playbook to reboot the machine infinite times

2020-04-17 Thread Srinivas Naram
https://docs.ansible.com/ansible/latest/plugins/lookup/items.html On Fri, Apr 17, 2020 at 1:00 PM Pavan Nr wrote: > Hi Srinivas, > > i have not tried , can you share the links if possible. > > regards, > Pavan > > On Friday, April 17, 2020 at 11:15:49 AM UTC+5:

Re: [ansible-project] Playbook to reboot the machine infinite times

2020-04-16 Thread Srinivas Naram
Did you try using items ? On Fri, Apr 17, 2020 at 11:07 AM Pavan Nr wrote: > Hi, > > Need help to create playbook, server need to reboot over night in loop, > like 100 time's I need to reboot and It should stop and collect the event > viewer logs. > > Do we have module already? > > Thanks, >

Re: [ansible-project] telnet issue

2020-04-13 Thread Srinivas Naram
Some time back just to test telnet module, I tried telnet for devices which had ssh as well as telnet access. However I was not successful and gave up. If you get this working, kindly reply with the solution. Thanks Srinivas. On Mon, Apr 13, 2020 at 1:44 PM Zaldy B wrote: > Hi Karl, > >

Re: [ansible-project] using hosts mentioned in inventory files in my tasks

2020-02-26 Thread Srinivas Naram
try {{ inventory_hostname }} Regards Srini On Wed, Feb 26, 2020 at 4:49 PM Vishal Bobade wrote: > Hello , > > I have a inventory file with some 5-6 hosts and I want use them in some of > my tasks/main.yml file. Could some one please suggest how can I do that . > > Lets say below is my

Re: [ansible-project] ansible-playbook command prompt like yes/no while connecting to managed node for the first time

2020-02-19 Thread Srinivas Naram
In ansible.cfg try setting host_key_checking = false On Thu, Feb 20, 2020 at 11:47 AM anilkumar panditi < anilkumar.pand...@gmail.com> wrote: > Hello, All > My ansible-playbook -i -vv command prompt like > yes/no while connecting to managed node for the first time. How can i avoid > the

Re: [ansible-project] Encrypted Password in Playbook

2020-01-24 Thread Srinivas Naram
with variables you want to define. File structure should be in yml format. On Thu, Jan 23, 2020 at 2:19 PM Srinivas Naram wrote: > Suggestions please. > > On Wed, Jan 22, 2020 at 9:43 AM Srinivas Naram > wrote: > >> Any suggestions would be greatly appreciated. >> >>

Re: [ansible-project] Encrypted Password in Playbook

2020-01-23 Thread Srinivas Naram
Suggestions please. On Wed, Jan 22, 2020 at 9:43 AM Srinivas Naram wrote: > Any suggestions would be greatly appreciated. > > On Tue, Jan 21, 2020 at 8:05 PM Srinivas Naram > wrote: > >> Hello Vladimir >> >> I have followed exactly same steps mentioned above

Re: [ansible-project] Encrypted Password in Playbook

2020-01-21 Thread Srinivas Naram
Any suggestions would be greatly appreciated. On Tue, Jan 21, 2020 at 8:05 PM Srinivas Naram wrote: > Hello Vladimir > > I have followed exactly same steps mentioned above and I see different > errors now. > > My steps > > - Set the Ansible Vault password file Env varia

Re: [ansible-project] Encrypted Password in Playbook

2020-01-21 Thread Srinivas Naram
quot;VARIABLE IS NOT DEFINED!" } My inventory file structure [ansible_enddevice_2] 192.168.249.107 On Tue, Jan 21, 2020 at 4:48 PM Vladimir Botka wrote: > On Tue, 21 Jan 2020 15:31:33 +0530 > Srinivas Naram wrote: > > > I am trying to maintain password (encrypted usin

Re: [ansible-project] Encrypted Password in Playbook

2020-01-21 Thread Srinivas Naram
/ansible/latest/user_guide/vault.html#use-encrypt-string-to-create-encrypted-variables-to-embed-in-yaml Am I reading this correctly? Please help. On Tue, Jan 21, 2020 at 1:47 PM Vladimir Botka wrote: > On Mon, 20 Jan 2020 22:07:21 -0800 (PST) > Srinivas Naram wrote: > > > In my

[ansible-project] Encrypted Password in Playbook

2020-01-20 Thread Srinivas Naram
Hi All, I am trying to use Ansible vault encrypted password in my playbook and don't see clear documentation on how to use it. Here is what I did so far - In ansible.cfg I have set the 'vault_password_file'. I have all my playbooks in a directory called devplaybooks. I have created a

Re: [ansible-project] Re: How to configure prompt with 2 inputs

2020-01-14 Thread Srinivas Naram
Thanks, that helped. On Mon, Jan 13, 2020 at 9:55 PM Uriel wrote: > I think the only thing missing from @Phil's answer is check_all: True > > On Monday, January 13, 2020 at 2:51:48 AM UTC-6, Srinivas Naram wrote: >> >> Thanks for our reply Phil. It did not work th

Re: [ansible-project] Re: How to configure prompt with 2 inputs

2020-01-13 Thread Srinivas Naram
> answer: > - y > - y > > > > On Friday, 10 January 2020 14:28:23 UTC, Srinivas Naram wrote: >> >> Hello Gurus >> >> I am working on ios_command module. This modules facilitates in execute >> commands on Cisco IOS devices. >>

[ansible-project] How to configure prompt with 2 inputs

2020-01-10 Thread Srinivas Naram
Hello Gurus I am working on ios_command module. This modules facilitates in execute commands on Cisco IOS devices. While running 'reload' command it is prompting for 2 inputs, "System configuration has been modified. Save? [yes/no]" > yes "Proceed with reload? [confirm] >

Re: [ansible-project] Facts overview

2019-10-18 Thread Srinivas Naram
https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#caching-facts HTH Srini On Fri, Oct 18, 2019 at 2:24 PM Andre Gronwald wrote: > I read somewhere that it is possible to cache facts - is it possible as > well to have those facts in an overview? my focus is on

Re: [ansible-project] skip_reason": "Conditional result was False".

2019-10-11 Thread Srinivas Naram
Hi Manish, I was facing same issue yesterday. To troubleshoot the issue I have gathered the facts and observed that ansible_processor kind of variables are list and have to be referenced with .0 or .1 try this out ansible_processor. *0* On Fri, Oct 11, 2019 at 4:07 PM Manish Kumar wrote: >

Re: [ansible-project] Re: How to use variables from one task in another task

2019-10-07 Thread Srinivas Naram
Hi All, Thanks for your time and efforts to help me out with the issue. I understood the mistak. I missed out making changes in the config file as described in below link https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#caching-facts TA On Fri, Oct 4, 2019 at

[ansible-project] Re: How to use variables from one task in another task

2019-10-04 Thread Srinivas Naram
Hello Ansible Gurus, Any inputs for me to resolve this issue. On Friday, September 20, 2019 at 1:07:20 PM UTC+5:30, Srinivas Naram wrote: > > Hello Ansible Gurus, > > I am new to Ansible and trying to get my hands dirty on playbooks. I wrote > an yaml file to use a variable from

Re: [ansible-project] How to use variables from one task in another task

2019-10-03 Thread Srinivas Naram
while evaluating conditional (hostvars['hostname2']['ansible_facts']['distribution'] == 'CentOS'): \"hostvars['hostname2']\" is undefined Any thoughts ? On Tue, Oct 1, 2019 at 11:04 PM Kai Stian Olstad < ansible-project+l...@olstad.com> wrote: > On 01.10.2019 11:14, Srinivas Naram w

Re: [ansible-project] How to use variables from one task in another task

2019-10-01 Thread Srinivas Naram
Sure. Attached output of hostvars. On Tue, Oct 1, 2019 at 7:41 PM Vladimir Botka wrote: > On Tue, 1 Oct 2019 18:39:54 +0530 > Srinivas Naram wrote: > > > - debug: > > var: hostvars > > > > shows all the hosts in my inventory file, so I believe my pla

Re: [ansible-project] How to use variables from one task in another task

2019-10-01 Thread Srinivas Naram
; > Try this one > > > > > when: "hostvars['hostname1']['ansible_facts']['distribution'] == > > > > > 'CentOS'" > > > > > > On Tue, 1 Oct 2019 12:41:22 +0530 > > > Srinivas Naram wrote: > > > > I have tried with your

Re: [ansible-project] How to use variables from one task in another task

2019-10-01 Thread Srinivas Naram
entOS" > > > > > > Try this one > > > when: "hostvars['hostname1']['ansible_facts']['distribution'] == > > > 'CentOS'" > > On Tue, 1 Oct 2019 12:41:22 +0530 > Srinivas Naram wrote: > > I have tried with your suggestion and got

Re: [ansible-project] How to use variables from one task in another task

2019-10-01 Thread Srinivas Naram
ditional (hostvars['hostname1']['ansible_facts']['distribution'] == 'CentOS'): \"hostvars['hostname1']\" is undefined\n\n -- Kindly help. Thanks On Mon, Sep 30, 2019 at 9:48 PM Vladimir Botka wrote: > On Mon, 30 Sep 2019 20:03:25 +0530 > Srinivas Naram wrote: >

Re: [ansible-project] How to use variables from one task in another task

2019-09-30 Thread Srinivas Naram
stribution'] == "CentOS" Can you help me with this? Thanks Srini. On Sat, Sep 21, 2019 at 3:39 AM Kai Stian Olstad < ansible-project+l...@olstad.com> wrote: > On 20.09.2019 09:37, Srinivas Naram wrote: > > Is there a provision to pass 'result' variable to second host ? &

Re: [ansible-project] Connection via Citrix

2019-09-25 Thread Srinivas Naram
Hello, Can you please provide more details on how you are moving forward with the setup ? Is any documentation available to understand how this can be achieved ? TIA -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this

[ansible-project] Connection via Citrix

2019-09-24 Thread Srinivas Naram
Hello Gurus, Few devices in my customer environment can be connected via Citrix. How to connect to devices which are accessible only via Citrix using Ansible ? Thanks -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from

[ansible-project] How to use variables from one task in another task

2019-09-20 Thread Srinivas Naram
Hello Ansible Gurus, I am new to Ansible and trying to get my hands dirty on playbooks. I wrote an yaml file to use a variable from one host tasks to another. Here is my code ( logically this code may not make sense in real world, I am trying to understand features in Ansible )