Cannot run playbooks on AWX

Hello,
i’am a new user AWX ! I developed playbooks who runs very well in my local server . I decided to test them on AWX.
I have an errror when i run the script in AWX.
Can someone help me please to reslove this issue ?
For example i want to test a script ansible who create for me a user into FORTIMANAGER (for firewall fortinet)
i have lot of variables ! Everything is OK and run in my local server.

create_user.yml :

---
- name: Create user
  fmgr_generic:
    method: add
    params:
      - url: pm/config/device/FR-0000SLAP866/vdom/root/user/ldap
        data:
          name: "{{ NameOfUser | default('default_name') }}"
          account-key-processing: "{{ AccountKeyProcessing }}"
          cnid: "{{ Cnid | default('default_cnid') }}"
          dn: "{{ Dn | default('default_dn') }}"
          group-member-check: "{{ GroupMemberCheck }}"
          member-attr: "{{ MemberAttr | default('default_ma') }}"
          secure: "{{ Secure }}"
          server: "{{ Server | default('default_server') }}"
          username: "{{ UserName | default('default_uName') }}"


**user_group.yml  :**

---
- hosts: all
  gather_facts: False
  vars_files: inventories/group_vars/user_group_vars

# Execution de l'ensemble des taches permettant la création
# et la suppression de tout ce qui concerne le groupe utilisateur
  tasks:
     - include: tasks/create_user.yml
#    - include: tasks/delete_user.yml
#    - include: tasks/create_group.yml
#    - include: tasks/delete_group.yml
#    - include: tasks/create_object_group.yml
#    - include: tasks/delete_object_group.yml

---------------------------------------------------------------------------------------------JOB error---------------------------------------------------------------------------------------------------

Identity added: /tmp/awx_301_nyncrby2/artifacts/301/ssh_key_data (/tmp/awx_301_nyncrby2/artifacts/301/ssh_key_data)

2
[WARNING]: Could not match supplied host pattern, ignoring: FortiManager

3

4
ERROR! couldn’t resolve module/action ‘fmgr_generic’. This often indicates a misspelling, missing collection, or incorrect module path.

5

6
The error appears to be in ‘/tmp/awx_301_nyncrby2/project/tasks/create_user.yml’: line 2, column 3, but may

7
be elsewhere in the file depending on the exact syntax problem.

8

9
The offending line appears to be:

10

11

Hi Dieye,

Looks like you selected create_user.yml tasks file instead of user_group.yml playbook. Select user_group.yml playbook in the AWX Job Template and re-run the JT to see if it helps.

Regards,
Ompragash

The fmgr_generic module is not part of the Ansible distribution. Setup requires you to apply patches to ansible to get it working. Documentation for their module indicates they recommend using their FortiManager Ansible Collection instead. Documentation on how to use the modules in their collection is available through that link.

Documentation for using collections with Tower and AWX is available here: Collections Support.

Documentation on using collections in Ansible is available here: Using Collections. You could install the collection directly into your project repository, but you may want to consider using the requirements method documented on that page.

If you must use the fmgr_generic module, you will want to create a custom virtual environment and patch that instance of ansible. Setting up virtual environments varies depending on how you deploy AWX, docker, kubernetes, OpenShift, etc… For information on using virtualenv with Tower and AWX, look here: Using virtualenv with Ansible Tower. You should also look at the docs in the AWX repository on GitHub, specifically, here: custom_virtualenvs.md.

Dave