March 2019
Beginner
490 pages
12h 40m
English
Ansible comes packed with a lot of built-in modules (for almost all tasks), but for some custom tasks, you can write custom modules with Python.
For example, we can use the common Ansible Boilerplate module as we can see in the documentation: http://docs.ansible.com/ansible/dev_guide/developing_modules_general.html or https://docs.ansible.com/ansible/2.3/dev_guide/developing_modules_general.html.
We can develop our own module to automate input from a playbook. Ansible also provides a Python library to parse user arguments and handle errors and returns. First, we will import the AnsibleModule class from the ansible.module_utils.basic package:
from ansible.module_utils.basic import AnsibleModuleif __name__ ...
Read now
Unlock full access