Thanks for the help, adjusted as suggested.
The formatting is tripping me up for sure, was hoping Atom would do a
better job at keeping me aligned there, but it's a bit more, you have an
error fix it at this point.
I get a different error now when I run it, one I fought with before, the
file exists for sure:
[unix@ansible01:~]$ ansible-playbook -i ansible/inventories/hosts ansible/
roles/linux/tasks/main.yml
PLAY [Linux VM setup]
*********************************************************************************************************************************************
TASK [Gathering Facts]
********************************************************************************************************************************************
ok: [centos7-x64-template]
TASK [adding groups]
**********************************************************************************************************************************************
fatal: [centos7-x64-template]: FAILED! => {"ansible_facts": {},
"ansible_included_var_files": [], "changed": false, "message": "Could not
find or access 'our_groups.yml'\nSearched
in:\n\t/automation/unix/ansible/roles/linux/tasks/vars/our_groups.yml\n\t/automation/unix/ansible/roles/linux/tasks/our_groups.yml\n\t/automation/unix/ansible/roles/linux/tasks/vars/our_groups.yml\n\t/automation/unix/ansible/roles/linux/tasks/our_groups.yml
on the Ansible Controller.\nIf you are using a module and expect the file
to exist on the remote, see the remote_src option"}
to retry, use: --limit @/automation/unix/ansible/roles/linux/tasks/
main.retry
PLAY RECAP
********************************************************************************************************************************************************
centos7-x64-template : ok=1 changed=0 unreachable=0 failed=1
[unix@ansible01:~]$ find . -name our_groups.yml -ls
1575401 4 -rw-r--r-- 1 unix operations 154 Nov 15 15:58 ./
ansible/roles/linux/vars/our_groups.yml
[unix@ansible01:~]$ find /automation -name our_groups.yml -ls
1575401 4 -rw-r--r-- 1 unix operations 154 Nov 15 15:58 /
automation/unix/ansible/roles/linux/vars/our_groups.yml
[unix@ansible01:~]$
---
- name: Linux VM setup
hosts: centos7-x64-template
remote_user: root
tasks:
- name: adding groups
include_vars:
file: our_groups.yml
- group:
name: "{{ item.name }}"
state: present
uid: "{{ item.gid }}"
with_items: "{{ our_groups }}"
...
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/ee5574e8-2483-413a-a1d8-936a95136ad5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.