From 734dcdcb33d952e6dc390ea83505c11ef31b4588 Mon Sep 17 00:00:00 2001 From: natarajangopi Date: Sat, 1 Feb 2020 16:07:59 +0530 Subject: [PATCH 1/2] New file d added --- d | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 d diff --git a/d b/d new file mode 100644 index 0000000..e69de29 From 579ac446e87f002cafd2691b17842b2f3ffb3f03 Mon Sep 17 00:00:00 2001 From: gopi natarajan <41574725+natarajangopi@users.noreply.github.com> Date: Sun, 9 Feb 2020 14:03:37 +0530 Subject: [PATCH 2/2] Add files via upload --- test1.yaml | 12 ++++++++++++ test2.yml | 17 +++++++++++++++++ test3.yml | 11 +++++++++++ test4.yml | 11 +++++++++++ test5.yml | 6 ++++++ test6.yml | 9 +++++++++ 6 files changed, 66 insertions(+) create mode 100644 test1.yaml create mode 100644 test2.yml create mode 100644 test3.yml create mode 100644 test4.yml create mode 100644 test5.yml create mode 100644 test6.yml 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