Skip to content

Commit

Permalink
Updted Common Role tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
mithuntechdevopstraining committed Mar 23, 2019
1 parent 86b8f01 commit 9c06558
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 24 deletions.
File renamed without changes.
7 changes: 5 additions & 2 deletions hosts
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[tomcat-servers]
localhost
[appServers]

172.31.0.120
[dbServers]
172.31.15.120
25 changes: 4 additions & 21 deletions roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
---
# Download and install EPEL for Centos/RHEL version 6
- name: Download EPEL Repo - Centos/RHEL 6
get_url: url=http://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm dest=/tmp/epel-release-latest-6.noarch.rpm
when: "ansible_os_family == 'RedHat' and ansible_distribution_major_version == '6'"

- name: Install EPEL Repo - Centos/RHEL 6
command: rpm -ivh /tmp/epel-release-latest-6.noarch.rpm creates=/etc/yum.repos.d/epel.repo
when: "ansible_os_family == 'RedHat' and ansible_distribution_major_version == '6'"

# Download and install EPEL for Centos/RHEL version 7
- name: Download EPEL Repo - Centos/RHEL 7
get_url: url=http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm dest=/tmp/epel-release-latest-7.noarch.rpm
when: "ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7'"

- name: Install EPEL Repo - Centos/RHEL 7
command: rpm -ivh /tmp/epel-release-latest-7.noarch.rpm creates=/etc/yum.repos.d/epel.repo
when: "ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7'"

- name: Install libselinux-python
yum: name=libselinux-python
- name: Install Common Softwares
yum:
name: ['vim','wget','git']
state: present
2 changes: 2 additions & 0 deletions site.retry
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
172.31.0.120
172.31.15.120
3 changes: 2 additions & 1 deletion site.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---
# This playbook deploys a simple standalone Tomcat 7 server.

- hosts: tomcat-servers
- hosts: appServers
become: yes
roles:
- common
- tomcat
- hosts: all
become: yes
roles:
- common

0 comments on commit 9c06558

Please sign in to comment.