Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for missing shll enviroment variables? #951

Open
YoSiJo opened this issue May 31, 2022 · 1 comment
Open

Workaround for missing shll enviroment variables? #951

YoSiJo opened this issue May 31, 2022 · 1 comment

Comments

@YoSiJo
Copy link

YoSiJo commented May 31, 2022

I want to use the nb_inventory_inventory and therefore need to pass in the API endpoint and token as "shell enviroments". What currently probably does not work with semaphore.

AWX/TOWER has the same problem and the following solution:

# For use in Ansible Tower (AWX), please see this blog from RedHat: https://www.ansible.com/blog/using-an-inventory-plugin-from-a-collection-in-ansible-tower
# The credential for NetBox will need to expose NETBOX_API and NETBOX_TOKEN as environment variables.
# Example Ansible Tower credential Input Configuration:

fields:
  - id: NETBOX_API
    type: string
    label: NetBox Host URL
  - id: NETBOX_TOKEN
    type: string
    label: NetBox API Token
    secret: true
required:
  - NETBOX_API
  - NETBOX_TOKEN

# Example Ansible Tower credential Injector Configuration:

env:
  NETBOX_API: '{{ NETBOX_API }}'
  NETBOX_TOKEN: '{{ NETBOX_TOKEN }}'

I couldn't find a suitable equivalent for this on your end.

Any idea or solution?

@YoSiJo YoSiJo changed the title Workaround for missing sehll enviroment variables? Workaround for missing shll enviroment variables? May 31, 2022
@dpskvn
Copy link
Contributor

dpskvn commented Jun 13, 2022

You could pass the ENV variable through the Semaphore unit file, although that's problematic, especially if you have several inventories that need different keys (which is the case that I have).

To be honest, we keep recommending Semaphore to our clients as a lightweight Ansible GUI and almost every time we have to abandon it because it lacks the support for environment variables.

I'm currently considering re-adding this functionality: #458 but am not sure whether it would get merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants