From 9122d82e11038fcd698c7b37b507425f1c522ac5 Mon Sep 17 00:00:00 2001 From: qtkhaja Date: Wed, 23 Dec 2020 08:21:50 +0530 Subject: [PATCH] Added play2 Added play2 fix --- Dec20/Inventories/hosts | 13 ++++++++++++- Dec20/Inventories/scenario1.yaml | 15 ++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Dec20/Inventories/hosts b/Dec20/Inventories/hosts index 4c8649f..1811a17 100644 --- a/Dec20/Inventories/hosts +++ b/Dec20/Inventories/hosts @@ -1,3 +1,14 @@ +[centos] +172.31.32.83 + +[ubuntu] localhost 172.31.45.255 -172.31.32.83 \ No newline at end of file + +[webserver] +172.31.32.83 +172.31.45.255 + +[appserver] +172.31.45.255 + diff --git a/Dec20/Inventories/scenario1.yaml b/Dec20/Inventories/scenario1.yaml index 8a60302..b4c776b 100644 --- a/Dec20/Inventories/scenario1.yaml +++ b/Dec20/Inventories/scenario1.yaml @@ -14,4 +14,17 @@ - name: install tree package: name: tree - state: present \ No newline at end of file + state: present +- name: install apache on centos + hosts: centos + become: yes + tasks: + - name: install apache + package: + name: httpd + state: present + - name: ensure apache is running + service: + name: httpd + enabled: yes + state: started