Hi all!
I have a problem with variables in inventory.
I have a project called ‘test’ (gitlab). Option “Update Revision on Launch” has been filled up.
I have a source called ‘test-source’. Options “Overwrite|Overwrite variables|Update on launch” have been filled up.
When I am doing some changes in group variables everything is going well and smoothly. The problem is with variables for ‘all’.
I am not able to sync it correctly. When I remove proper variables, after sync this one is still visible. When I change some value of a variable, the new value is visible correctly.
Any ideas on how to cope with that?
kurokobo
(kurokobo)
December 27, 2023, 3:48pm
2
Hi, there is an open issue for this topic. Several workarounds have been offered, but none seem to be ideal yet.
opened 03:17PM - 27 Jan 22 UTC
component:api
### Please confirm the following
- [X] I agree to follow this project's [code… of conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html).
- [X] I have checked the [current issues](https://github.com/ansible/awx/issues) for duplicates.
- [X] I understand that AWX is open source software provided for free and that I might not receive a timely response.
### Summary
Using sourced from project inventory update group_vars/all.yaml variables are not deleted
After removing variable in git repo group_vars/all.yaml , it stays in awx default groups vars although it is gone.
Change value of variable - OK
Specific groups variables are not effected by this
Specific host vars are not effected by this.
Inventory has these "Enabled Options":
Overwrite local groups and hosts from remote inventory source
Overwrite local variables from remote inventory source
Update on project update
```
diff --git a/inventory/avv-prod/group_vars/all.yaml b/inventory/avv-prod/group_vars/all.yaml
index af2262cf..2a7c90de 100644
--- a/inventory/avv-prod/group_vars/all.yaml
+++ b/inventory/avv-prod/group_vars/all.yaml
@@ -52,4 +52,3 @@ git_dest: "{{ lookup('env', 'PWD') }}"
grafana_url: "https://grafana.host.zz"
grafana_user: "admin"
grafana_password: "123456"
-test_var: test_zzz
```
After project refresh (+inventory update on dependency):
https://awx-test.host.zz/#/inventories/inventory/8/details
Inventories -> avv-prod -> Variables
```
<skiped>
grafana_url: "https://grafana.host.zz"
grafana_user: "admin"
grafana_password: "123456"
test_var: test_zzz
```
### AWX version
19.5.1
### Installation method
kubernetes
### Modifications
yes
### Ansible version
2.12.1
### Operating system
Debian 10.11
### Web browser
_No response_
### Steps to reproduce
Install awx 19.5.1 using operator latest on Kubernetes
Create inventory which is sourced from project using options:
```
Overwrite local groups and hosts from remote inventory source
Overwrite local variables from remote inventory source
Update on project update
```
Add variable to inventory git repo group_vars/all.yaml
Commit git, push git, update project on awx.
Check your variable in awx inventory group all.
Delete it in git
Commit git, push git, update project on awx.
Check your variable in awx inventory group all.
### Expected results
It should be gone.
### Actual results
It still exists.
### Additional information
Custom-ee
```
(.local) [d@z1 ansible-builder]$ cat requirements.txt
urllib3
boto3
influxdb
dnspython
netaddr
psutil
bcrypt
cryptography>=3.0
Jinja2==2.11.3
jmespath==0.10.0
paramiko
pyasn1
PyNaCl
python-dateutil
six
supervisor
virtualenv
netaddr
asn1crypto
babel
cffi
idna
markupsafe
ply
pycparser
pytz
pyyaml
ara
PyMySQL
```
```
(.local) [domas@x1 ansible-builder]$ cat requirements.yml
---
collections:
- community.general
- ansible.posix
- ansible.utils
- community.aws
- community.crypto
- community.grafana
- community.mysql
- community.zabbix
- community.crypto
```
2 Likes
Oooo, thanks!
I will use the workaround with custom group called ‘global’.
Strongly belive that that case will be solved soon.
system
(system)
Closed
January 27, 2024, 2:44pm
4
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.