I can’t solve my problem for several days. maybe someone had a similar situation.
I have an inventory in awx. in this inventory, I have a script written in python as a source. this script is hosted in gitlab. variables are also used in this script. I have successfully added a yaml file with my variables that are necessary for the script to work to the inventories/my-project/group_vars/ directory. these permutations have been successfully pulled up from gitlab and are located in inventory variables (the Variables field). but how do I make sure that these same variables are still displayed in the source variables (Source variables field)?
I also tried this way, for example, to access variables from a script, but an error occurs BRANCH_NAME = os.environ[‘branch_name’]
that is, I need to understand how to make sure that automatically variables from gitlab are transferred to Source variables or how to correctly access variables from the Variables inventory from the script.
Source variables are those that are used by a plugin to configure for syncing inventories. They are not a reflection of variables from individual hosts/groups/inventories:
If your script runs successfully, you should see the variables populated under “hosts” or “inventory” page. You WON"T see them populated on the screenshot you pasted above. Do you see the variables under hosts or inventory?
You see, in order for the script to run successfully, I need to pass variables to the python script that are located in the gitlab inventory/my-project/group_vars/all/my-variables.yml repository. My variables are successfully transferred from the gitlab repository to the awx inventory (the second screenshot from my first message), but are not transferred to the inventory source (the fourth screenshot from my first message). How do I make variables from the gitlab inventory repository/my-project/group_vars/all/my-variables.yml to the inventory source?
at the moment I am getting variables to successfully run a python script like this. but this is wrong. it is necessary that they are pulled up automatically from inventory/my-project/group_vars/all/my-variables.yml