Creating custom module

110 views
Skip to first unread message

Jason Edelman

unread,
Mar 27, 2014, 7:54:10 PM3/27/14
to ansible...@googlegroups.com
Hi All,

New guy to Ansible here...

- New python module called 'pinger_test.py' and put it in ./ansible/library.
- Ran 'make webdocs' while in ./ansible
Playbook is:
---
- name: ping automated verification testing
  hosts: routers
  connection: local
  gather_facts: no

  tasks:
  - name: automated pings for {{ inventory_hostname }}
    pinger_test:
      source_host = {{ inventory_hostname }}
      remote_hosts = {{ remote_hosts }}

-------------------
When I run the playbook, I keep getting the following output:

cisco@onepk:~/apps/auto-test$ sudo ansible-playbook -i hosts pinger
ERROR: pinger_test is not a legal parameter in an Ansible task or handler


What else can I try to get this going?

Thanks,
Jason


Brian Coca

unread,
Mar 31, 2014, 7:52:02 PM3/31/14
to ansible...@googlegroups.com
remove the .py from the file


--
Brian Coca
Stultorum infinitus est numerus
0110000101110010011001010110111000100111011101000010000001111001011011110111010100100000011100110110110101100001011100100111010000100001
Pedo mellon a minno

Jason Edelman

unread,
Apr 1, 2014, 8:20:08 AM4/1/14
to ansible...@googlegroups.com

Okay, so my error was very very stupid.  Everything was correct, but I was executing the playbook as such ‘sudo ansible-playbook xxxxx’ and believe since was sudo’ing, I was losing the environment variables that were previously set.  Doh!  

Reply all
Reply to author
Forward
0 new messages