-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathboth.yml
More file actions
49 lines (49 loc) · 1.24 KB
/
Copy pathboth.yml
File metadata and controls
49 lines (49 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
- hosts: all
become: True
vars:
- java_version: 1.8.0
tasks:
- name: Installing Packages on Redhat
yum:
name: "{{item}}"
state: present
with_items:
- git
- docker
- httpd
- java-{{java_version}}-openjdk-devel
when: ansible_os_family == "RedHat"
- name: Installing git and apache on ubuntu
apt:
name: "{{item}}"
state: present
with_items:
- git
- apache2
when: ansible_os_family == "Debian"
- name: Starting docker and apache
service:
name: "{{item}}"
state: started
enabled: yes
with_items:
- httpd
- docker
when: ansible_os_family == "RedHat"
- name: Starting Apache server
service:
name: apache2
state: started
enabled: yes
when: ansible_os_family == "Debian"
- name: Coping index.html to apache server from github
copy:
src: ./code/index.html
dest: /var/www/html
when: ansible_os_family == "RedHat"
- name: Coping Index.html
copy:
src: ./code/index.html
dest: /var/www/html
when: ansible_os_family == "Debian"