file vars lesson completed
This commit is contained in:
17
playbooks/file_var_playbook.yml
Normal file
17
playbooks/file_var_playbook.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
- hosts: labservers
|
||||
vars:
|
||||
userFile: /home/cloud_user/vars/list
|
||||
tasks:
|
||||
- name: create file
|
||||
file:
|
||||
state: touch
|
||||
path: "{{ userFile }}"
|
||||
- name: list users
|
||||
lineinfile:
|
||||
path: "{{ userFile }}"
|
||||
line: "{{ item }}"
|
||||
with_items:
|
||||
- "{{ staff }}"
|
||||
- "{{ faculty }}"
|
||||
- "{{ other }}"
|
||||
Reference in New Issue
Block a user