part 2 completed
This commit is contained in:
11
playbooks/loop_playbook.yml
Normal file
11
playbooks/loop_playbook.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
- hosts: labservers
|
||||
become: yes
|
||||
tasks:
|
||||
- name: create users
|
||||
user:
|
||||
name: "{{item}}"
|
||||
with_items:
|
||||
- sam
|
||||
- john
|
||||
- bob
|
||||
10
playbooks/when_playbook.yml
Normal file
10
playbooks/when_playbook.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
- hosts: labservers
|
||||
become: yes
|
||||
tasks:
|
||||
- name: edit index
|
||||
lineinfile:
|
||||
path: /var/www/html/index.html
|
||||
line: "I'm back!!!"
|
||||
when:
|
||||
- ansible_hostname == "innaghiyev1c"
|
||||
Reference in New Issue
Block a user