Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added d
Empty file.
12 changes: 12 additions & 0 deletions test1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
- hosts: worker2
become: true
tasks:
- name: Installing httpd
yum:
name: httpd
state: latest
- name: starting httpd
service:
name: httpd
state: started
17 changes: 17 additions & 0 deletions test2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
- hosts: worker1
become: true
tasks:
- name: Installing httpd
yum:
name: httpd
state: latest
- name: starting httpd
service:
name: httpd
state: started
- name: copy a file from master to slave & assign permissions
copy:
src: /var/www/html/index.html
dest: /var/www/html/

11 changes: 11 additions & 0 deletions test3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- hosts: worker1
become: true
tasks:
- name: creating a file
file:
state: touch
path: /opt/testing

- name: writing to the file
shell: echo "Hostname" >> /opt/testing
11 changes: 11 additions & 0 deletions test4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- hosts: worker2
become: true
tasks:
- name: using regex with lineinfile
lineinfile:
path: /opt/testing
regexp: '^Hostname'
insertafter: '^#Hostname'
line: Testing regex

6 changes: 6 additions & 0 deletions test5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- hosts: web
become: true
tasks:
- name: debug file
debug: msg="This is checking message"
9 changes: 9 additions & 0 deletions test6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
- hosts: web
become: true
tasks:
- shell: cat /etc/motd
register: motd_contents
- debug: msg="stdout{{ motd_contents }}"