-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathmain.yml
93 lines (79 loc) · 2.47 KB
/
main.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
- name: Install apache packages
yum:
lock_timeout: 180 # wait up to 3 minutes for a lock ansible/ansible#57189
name: "{{ item }}"
state: installed
with_items:
- httpd-devel
- mod_ssl
- mod_proxy_html
- name: Make apache own htdocs directory
file:
state: directory
path: "{{ m_htdocs }}"
owner: apache
group: apache
mode: 0775
- name: Ensure mw-temp directory configured
file:
state: directory
path: "{{ m_paths.mw_temp.path }}"
owner: "{{ m_paths.mw_temp.owner }}"
group: "{{ m_paths.mw_temp.group }}"
mode: "{{ m_paths.mw_temp.mode }}"
- name: Ensure user meza-ansible and alt-meza-ansible in group "apache"
user:
name: "{{ item }}"
# add onto groups
groups: apache
append: yes
with_items:
- meza-ansible
- alt-meza-ansible
- name: write the apache config file
template: "src=httpd.conf.j2 dest={{ m_apache_conf }}"
notify:
- restart apache
- name: Ensure Apache environment variables set properly
template:
src: etc-sysconfig-httpd.j2
dest: /etc/sysconfig/httpd
notify:
- restart apache
- name: Install PHP
include: php.yml
# http://docs.ansible.com/ansible/playbooks_roles.html#dynamic-versus-static-includes
static: yes
- name: Ensure Composer configured
include_role:
name: composer
# - name: Ensure PHP profiling configured
# include: profiling.yml
# # http://docs.ansible.com/ansible/playbooks_roles.html#dynamic-versus-static-includes
# static: yes
# when: m_setup_php_profiling
# If profiling not enabled, disable MongoDB if it exists (e.g. profiling had
# previously been enabled)
- name: Check if MongoDB service exists
stat: path=/etc/init.d/mongod
register: mongo_service_status
- name: Stop MongoDB service if profiling is disabled
service:
name: mongod
state: stopped
when: mongo_service_status.stat.exists and not m_setup_php_profiling
# Now that PHP is installed, start apache
- name: ensure apache is running (and enable it at boot)
service:
name: httpd
state: started
enabled: yes
when: docker_skip_tasks is not defined or not docker_skip_tasks
# Might need these for SELinux to be turned back on
# - name: Configure SELinux to start mysql on any port
# seboolean: name=mysql_connect_any state=true persistent=yes
# when: sestatus.rc != 0
# - name: Configure SELinux to allow httpd to connect to remote database
# seboolean: name=httpd_can_network_connect_db state=true persistent=yes
# when: sestatus.rc != 0