Git Product home page Git Product logo

ansible_constructed_inventory's People

Watchers

 avatar  avatar

ansible_constructed_inventory's Issues

Source script fails to retrieve credentials values

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:

fields:
  - id: url
    type: string
    label: url
  - id: apptoken
    type: string
    label: apptoken
    secret: true
  - id: usertoken
    type: string
    label: usertoken
    secret: true
required:
  - apptoken
  - usertoken
  - url

Injector configuration:

env:
    GLPI_URL: '{{ url }}'
    GLPI_APPTOKEN: '{{ apptoken }}'
    GLPI_USERTOKEN: '{{ usertoken }}'

source file glpi.yml:

plugin: unistra.glpi.inv
glpi_url: "{{ GLPI_URL }}"
glpi_apptoken:  "{{ GLPI_APPTOKEN }}"
glpi_usertoken: "{{ GLPI_USERTOKEN }}"
glpi_verify_certs: False
glpi_use_headers: True
queries:
  #
  # Servers by system
  #
  glpi-non-prod-all-hosts:
    itemtype: Computer
    fields:
    - 1   # name
    - 4   # ComputerType.name
    - 31  # State.completename
    criteria:
    - { link: AND, field: 31, searchtype: contains, value: '^EN SERVICE$' }
    hostname: $1
    hostvars:
      computertype: $4
      state: $31

and i've created credentails and put the values as shown:

glpi_credentials

and i've configured the source with the target credentials:

source credentials

but i'm always getting this error message :

source-error

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.