From eff623019a022a06a75219ed310c47449d7958d5 Mon Sep 17 00:00:00 2001 From: srinu Date: Thu, 21 Mar 2024 22:29:12 +0530 Subject: [PATCH 1/2] done changes --- 06copy.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/06copy.yml b/06copy.yml index 25aaecf..4947bc1 100644 --- a/06copy.yml +++ b/06copy.yml @@ -1,11 +1,7 @@ + --- - hosts: all become: true tasks: - name: Copy ansible inventory file to all hostmachines - copy: src=/etc/ansible/hosts - dest=/tmp/ - owner=root - group=root - mode=0666 -... + From 3928e73f200e5e99cccb4ac73798e7febba8d964 Mon Sep 17 00:00:00 2001 From: srinu Date: Fri, 22 Mar 2024 12:03:09 +0530 Subject: [PATCH 2/2] Deleted 2 yml files --- loops.yml | 10 ---------- when.yaml | 28 ---------------------------- 2 files changed, 38 deletions(-) delete mode 100644 loops.yml delete mode 100644 when.yaml diff --git a/loops.yml b/loops.yml deleted file mode 100644 index a225213..0000000 --- a/loops.yml +++ /dev/null @@ -1,10 +0,0 @@ -- hosts: all - become: yes - - tasks: - - name: Install Packages - yum: name={{ item }} update_cache=yes state=latest - with_items: - - vim - - lsof - - nano \ No newline at end of file diff --git a/when.yaml b/when.yaml deleted file mode 100644 index b84a860..0000000 --- a/when.yaml +++ /dev/null @@ -1,28 +0,0 @@ ---- -- hosts: all - #gather_facts: no - become: yes - tasks: - - name: Install Apache HTTP server on RedHat Server - yum: - name: httpd - state: present - when: ansible_os_family == "RedHat" - - name: Install Apache HTTP server on Ubuntu server - apt: - name: apache2 - state: present - when: ansible_os_family == "Debian" - - name: Install Apache HTTP server on CentOS server - yum: - name: httpd - state: present - when: - - ansible_facts['distribution'] == "CentOS" - - ansible_facts['distribution_major_version'] == "6" - - name: Shutdown CentOS 6 and Debian 7 Servers - command: /sbin/shutdown -t now - when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "6") or - (ansible_facts['distribution'] == "Debian" and ansible_facts['distribution_major_version'] == "7") - -#https://docs.ansible.com/ansible/latest/user_guide/playbooks_conditionals.html