Trying to create groups and then users using with files and its not working…How should the lists be represented in the groups vars file and the users vars file?
It doesnt like it just as text below…how am I supposed to list the values out? How do people normally create a few users and groups like this?
groups.yml
devops
dbadmin
business
users.yml
tom
dave
joe
Playbook
— # Users and Groups
- hosts: localhost
vars_files: - groups.yml
- users.yml
tasks: - name: Create groups
group:
name: “{{ item }}”
state: present
with_file: - groups.yml
- name: Create users
user:
name: “{{ item }}”
state: present
with_file: - users.yml