How to access the hostname from a new Python module in Ansible -



How to access the hostname from a new Python module in Ansible -

i planning implement new ansible module run via local connection , create remote api calls host. there way in access name of host/ip address module? create decision on api utilize based on that.

i'm assuming doing like, say, operating on network appliance jump host.

right i'm not seeing inventory_host in ansiable module base of operations class, in case is:

ansible_connection: local tasks: - name: config net app myconfig: action=create_rule host={{inventory_host}}

then create host parameter of module.

then inventory file might like:

[firewalls] host123 host456 host789

ansible ansible-playbook ansible-awx

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -