-
Notifications
You must be signed in to change notification settings - Fork 9
/
main.yml
54 lines (43 loc) · 1.15 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
---
- name: Configure all servers.
hosts: all
become: yes
roles:
- geerlingguy.security
- name: Configure Varnish load balancer server.
hosts: varnish
become: yes
roles:
- role: geerlingguy.varnish
vars:
varnish_default_vcl_template_path: templates/default.vcl
- name: Configure PHP application servers.
hosts: php
become: yes
roles:
- geerlingguy.apache
- geerlingguy.php_roles.php_versions
- geerlingguy.php_roles.php
tasks:
- name: Install apache mod_php package.
package:
name: "libapache2-mod-php{{ php_version }}"
state: present
notify: restart apache
- name: Ensure default index page is removed.
file:
path: /var/www/html/index.html
state: absent
- name: Set colors appropriately.
set_fact:
background_color: "{{ '#1f8dd6' if (inventory_hostname == groups['php'][0]) else '#29335c'}}"
tags: ['deploy']
- name: Copy project files into place.
template:
src: "{{ item }}"
dest: "/var/www/html/{{ item }}"
mode: 0644
loop:
- styles.css
- index.php
tags: ['deploy']