This project implements an AWX Execution Environment required to build an AWX inventory from a GLPI installation.
This project uses the work done at the unistra/ansible-collection-glpi GitHub project.
Warning
|
For the sake of brevity awx --conf.host (1)
--conf.username (2)
--conf.token (3)
|
awx execution_environments create (1)
--name (2)
--image (3)
--description (4)
--pull (5)
-
Command to create an Execution Environment
-
Name of the Execution Environent
-
Container image
-
Description of the EE
-
Pull options [,always,missing,never]
Sample execution.
awx --conf.host http://awx.localdomain \
--conf.username janedoe \
--conf.token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \
execution_environments create \
--name "AWX trikorasolns GLPI ee" \
--image quay.io/trikorasolns/awx-ee-glpi:latest \
--description "GLPI inventory" \
--pull always
awx projects create \
--name "unistra/ansible-collection-glpi" \
--organization <ID> \
--scm_type git \
--scm_url https://github.com/unistra/ansible-collection-glpi.git
Create the inventory.
awx inventories create \
--name glpi \
--organization <ID> \
--scm_type git \
--scm_url https://github.com/unistra/ansible-collection-glpi.git
Create the inventory source. The inventory ID is collected by the previous command.
awx inventory_sources create \
--name glpi-api \
--inventory <inventory_ID> \
--execution_environment <ExecutionEnvironment_ID> \
--source scm --source_project <Project_ID> \
--source_path "scripts/inventory/glpi-api.py" \
--enabled_var "glpi.glpi_state" --enabled_value "Operational" \
--source_vars '{"ANSIBLE_GLPI_URL": "http://glpi.localdomain/apirest.php/", "ANSIBLE_GLPI_APPTOKEN": "xxxxxxxxxxxxxxxxxxxxxxx", "ANSIBLE_GLPI_USERTOKEN": "yyyyyyyyyyyyyyyyyyyyyyy", "ANSIBLE_GLPI_FILE": "/runner/glpi-api.yml"}'
The previous source variables are the following yaml
.
ANSIBLE_GLPI_URL: http://glpi.localdomain/apirest.php/ (1)
ANSIBLE_GLPI_APPTOKEN: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (2)
ANSIBLE_GLPI_USERTOKEN: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (3)
ANSIBLE_GLPI_FILE: /runner/glpi-api.yml (4)
-
GLPI API URL.
-
Application Token
-
User Token
-
Location of the glpi-api.yaml file