Hello,
I would like to copy some files specified by a group_var. But while running my playbook I got the fatal error that the variable given is undefined. But first things first. My directory structure looks like:
`
roles/mgmt/
– files
– foo
-- bar -- group_vars
– mgmt
– handlers
-- main.yml -- tasks
– main.yml
-- templates
– example.j2
`
I use a inventory file for staging which lies next to the directory roles and contains a specific group among other things:
`
ls -l
drwxr-xr-x. 2 root root 4096 Aug 3 2016 group_vars
drwxr-xr-x. 2 root root 4096 Jul 14 2016 host_vars
-rw-r–r–. 1 root root 2962 Feb 20 15:23 hosts
drwxr-xr-x. 7 root root 4096 Feb 20 13:30 roles
-rw-r–r–. 1 root root 169 Feb 20 15:19 mgmt.yml
-rw-r–r–. 1 root root 284 Feb 20 14:37 staging
cat staging
[mgmt]
rhel-t2.example.com
`
My mgmt.yml looks as follows:
`