file vars lesson completed

This commit is contained in:
Ilgar_Naghiyev
2020-03-05 14:58:39 +01:00
parent d90120d49f
commit eb4521d489
2 changed files with 64 additions and 2 deletions

View 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 }}"