forked from javahometech/ansible-december
-
Notifications
You must be signed in to change notification settings - Fork 555
Expand file tree
/
Copy pathgit-webservers-deploy.yml
More file actions
37 lines (36 loc) · 939 Bytes
/
git-webservers-deploy.yml
File metadata and controls
37 lines (36 loc) · 939 Bytes
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
---
- hosts: webservers
become: yes
tasks:
- name: install apache,git on ubuntu
apt:
name: "{{item}}"
state: present
with_items:
- apache2
- git
when: ansible_distribution == 'Ubuntu'
- name: install apache server on Linux
yum:
name: "{{item}}"
state: present
with_items:
- httpd
- git
when: ansible_distribution == 'RedHat'
- name: start apache server and enable
service:
name: httpd
state: started
enabled: yes
when: ansible_distribution == 'RedHat'
- name: start apache server and enable
service:
name: apache2
state: started
enabled: yes
when: ansible_distribution == 'Ubuntu'
- name: deploy website on to apache by cloning from git
git:
repo: https://github.com/javahometech/javahome-app
dest: /var/www/html/