-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy2.yml
48 lines (48 loc) · 1.07 KB
/
deploy2.yml
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
---
- hosts: rhel_ansible
become: yes
tasks:
- name: install apache
yum:
name: httpd
state: latest
- name: create user and add them to the apache group
user:
name: "{{ item }}"
groups: apache
loop:
- will
- myles
- name: create index.html
template:
src: /home/cloud_user/ansible/templates/index.j2
dest: /var/www/html/index.html
owner: apache
group: apache
mode: 0644
- name: start and enable httpd
service:
name: httpd
state: started
enabled: yes
- hosts: debservers
become: yes
tasks:
- name: install postgresql
yum:
name: postgresql-server
state: latest
- name: initailize db cluster
command: /usr/bin/postgresql-setup iinitdb
- name: create users
user:
name: "{{ item }}"
groups: postgres
loop:
- corey
- aaron
- name: start and enable postgres
service:
name: postgresql
state: started
enabled: yes