diff --git a/d b/d new file mode 100644 index 0000000..e69de29 diff --git a/test1.yaml b/test1.yaml new file mode 100644 index 0000000..78b4d95 --- /dev/null +++ b/test1.yaml @@ -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 \ No newline at end of file diff --git a/test2.yml b/test2.yml new file mode 100644 index 0000000..1368ccb --- /dev/null +++ b/test2.yml @@ -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/ + \ No newline at end of file diff --git a/test3.yml b/test3.yml new file mode 100644 index 0000000..f498826 --- /dev/null +++ b/test3.yml @@ -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 \ No newline at end of file diff --git a/test4.yml b/test4.yml new file mode 100644 index 0000000..78be219 --- /dev/null +++ b/test4.yml @@ -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 + \ No newline at end of file diff --git a/test5.yml b/test5.yml new file mode 100644 index 0000000..0ce2764 --- /dev/null +++ b/test5.yml @@ -0,0 +1,6 @@ +--- + - hosts: web + become: true + tasks: + - name: debug file + debug: msg="This is checking message" \ No newline at end of file diff --git a/test6.yml b/test6.yml new file mode 100644 index 0000000..4d84559 --- /dev/null +++ b/test6.yml @@ -0,0 +1,9 @@ +--- + - hosts: web + become: true + tasks: + - shell: cat /etc/motd + register: motd_contents + - debug: msg="stdout{{ motd_contents }}" + + \ No newline at end of file