for static groups vars to be loaded try adding the group in a static
file also, even if just empty.
static_inventory:
[test_env_test]
for static groups vars to be loaded try adding the group in a static
file also, even if just empty.
static_inventory:
[test_env_test]
added line to “./inventory/test/test” as suggested:
`
[local]
localhost target_environment=“test” dev_key=“aws-xxx”
[tag_env_test]
`
No change. Variable is still not defined.
loaded after all InventoryParsers are done.
Which ansible version are you using?
I think that was a bug in 1.7, solved in 1.8, not sure if backported.
`
$ ansible --version
ansible 1.8.2
configured module search path = None
$ ansible-playbook --version
ansible-playbook 1.8.2
configured module search path = None
`
Is there anything else I can show to work out whether I have made a mistake or there is a bug?
Perhaps if you could put a minimal example in a gist, that reproduces this?
Edited out a proof of concept from the repo:
I'm afraid I don't have any AWS credentials to test this.
Can you perhaps provide the plain json dump - can be redacted?
Are you looking for the output of the config playbook with -vvvv?
no the output of your inventory plugin, which is json
Seems I can’t reproduce your problem:
[mstr] serge@cyberlab:~/tmp/ansible-test$ tree
.
├── aws-configure.yml
├── aws-provision.yml
├── inventory
│ ├── ec2.py-output.json
│ └── group_vars
│ └── tag_env_test.yml
├── README.md
└── vars
├── aws_secrets.yml
└── aws_vars.yml
3 directories, 7 files
[mstr] serge@cyberlab:~/tmp/ansible-test$ ANSIBLE_NOCOWS=1 ansible-playbook -i inventory aws-configure.yml
PLAY [!local;tag_role_db:&tag_status_new] *************************************
TASK: [debug var=groups[‘tag_env_test’]] **************************************
ok: [54.x] => {
“groups[‘tag_env_test’]”: [
“54.x”
]
}
TASK: [debug var={{ region }}] ************************************************
ok: [54.x] => {
“eu-west-1”: “eu-west-1”
}
PLAY RECAP ********************************************************************
54.x : ok=2 changed=0 unreachable=0 failed=0
Tested with ansible 1.7.2, 1.8.2 and latest devel.