Reason number 1
You are using an older version of Ansible that did not have the module you are trying to run.
How to check it?
Open the list of modules module documentation and find the documentation page for your module.
Read the title at the top of the page - it usually shows the version of Ansible in which the module was introduced. For instance:
New in version 2.2.
, Ansible . Run:
ansible-playbook
. - :
ansible-playbook 2.4.1.0
№ 2
my_role/tasks/main.yml
.
tasks/main.yml
. :
---
- name: Configure servers
hosts: my_hosts
tasks:
- name: My first task
my_module:
parameter1: value1
Ansible hosts
tasks
. , .
: tasks/main.yml
:
- name: My first task
my_module:
parameter1: value1
№ 3
.
, . , users
user
, Ansible " ".
Ansible . , , "" .
, qLQn1BHxzirz
, Ansible . , "" .
№ 4
, Ansible.
, , Ansible.
, - , , .
modules
, .
ANSIBLE_LIBRARY
--module-path
.
, , :
ansible-playbook
:
=
2.4 .
№ 5
.
. :
- name: My task
become: true