Now that we have written our very first module for Ansible, we should give it a go in a playbook. Ansible looks at several places for its modules—first it looks at the place specified in the
library key in its
config file (
/etc/ansible/ansible.cfg), next it will look at the location specified using the
--module-path argument in the command line, then it will look in the same directory as the playbook for a
library directory containing modules, and finally it will look in the
library directory for any roles that may be set.
Let's create a playbook that uses our new module and place it in a
library directory in the same place so that we can see it in action. Here is a playbook that uses the
--- - name: Test the ...