ansible routers -m ans_check_dis.py -a 'user=someuser host=somehost password=somepassword' -k
Now I am trying to build this into a playbook to be called and have the variables used as the arguments for the module. I have tried a bunch of different iterations and tried searching for it and can't seem to find how to make this work. Any recommendations or guidance would be greatly appreciated.
--
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/60e7e71f-705a-44e3-af22-498259cb7ef8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
---
- name: Run the Command on the switch
ans_check_dis.py:
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/94c64e96-9054-419e-bf8e-5852402b65ea%40googlegroups.com.
jjenkins@CAARPWATCH:~/ANSIBLE/TEST$ ansible-playbook site.yml -kSSH password:
PLAY [Lookup information on the Switch] ***************************************
GATHERING FACTS ***************************************************************
ok: [localhost]
TASK: [router | Run the Command on the switch] ********************************
fatal: [localhost] => failed to parse: Traceback (most recent call last):
File "/home/jjenkins/.ansible/tmp/ansible-tmp-1411433982.14-168150244858379/ans_check_dis.py", line 38, in <module>
remote_conn_pre.connect(dest, username=userid, password=passw, allow_agent=False,look_for_keys=False)
NameError: name 'dest' is not defined
FATAL: all hosts have already failed -- aborting
PLAY RECAP ********************************************************************
to retry, use: --limit @/home/jjenkins/site.retry
localhost : ok=1 changed=0 unreachable=1 failed=0
---
routers:
- { user: somepass, host: somehost, password: somepass }
---
- name: Run the Command on the switch
ans_check_dis.py: user="{{item.user}}" password="{{item.password}}" host="{{item.host}}"
with_items: routers
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/ae2f28c8-f2e9-4d94-a952-ac80b4e5a101%40googlegroups.com.