Open samirakhelifi opened 1 year ago
Hi @samirakhelifi - your setup looks good. I definitely would remove these lines from your configuration because we can't pass ansible variables to an inventory plugin.
glpi_url: "{{ GLPI_URL }}"
glpi_apptoken: "{{ GLPI_APPTOKEN }}"
glpi_usertoken: "{{ GLPI_USERTOKEN }}"
What happens when you set those environment variables from a command line and run the inventory plugin from the command line? e.g.
export GLPI_URL=<URL>
export GLPI_APPTOKEN=<TOKEN>
export GLPI_USERTOKEN=<USER_TOKEN>
ansible-inventory -i glpi.yml --list
Hello Mr.Harrison, first of all thank you for your blog "Ansible Constructed Inventory Plugin". Actually, i wanted to create dynamic inventory (that will contain dynamic groups) from GLPI so i used two plugins: "Ansible dynamic inventory for GLPI" customized plugin to retrieve infomation from GLPI and constructed plugin to create dynamic groups as you recommended, it does work properly in AWX but when i tried to use AWX credential management i'm always having the error indicating that he couldn't parse the variables:
Input configuration:
Injector configuration:
source file glpi.yml:
and i've created credentails and put the values as shown:
and i've configured the source with the target credentials:
but i'm always getting this error message :
Also when i tried to remove these three lines from my source script as you recommended :
<glpi_url: "{{ GLPI_URL }}" glpi_apptoken: "{{ GLPI_APPTOKEN }}" glpi_usertoken: "{{ GLPI_USERTOKEN }}" >
=> I'm almost getting the same error that he can't find glpi access details.