-
Notifications
You must be signed in to change notification settings - Fork 0
/
apache2_config.yaml
41 lines (32 loc) · 1.1 KB
/
apache2_config.yaml
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
---
- hosts: apache2
become: true
tasks:
- name: ensure apache2 is at the latest version
apt: name=apache2 state=latest
- name: stop apache2, to make changes
service:
name: apache2
state: stopped
- name: remove the default-web site-enabled link
file:
path: /etc/apache2/sites-enabled/000-default.conf
state: absent
- name: copy the apache2 config file for static-site to sites-available
copy:
src: /home/vagrant/config/static_site.conf
dest: /etc/apache2/sites-available/static_site.conf
- name: create symlink in sites-enabled
file:
src: /etc/apache2/sites-available/static_site.conf
dest: /etc/apache2/sites-enabled/static_site.conf
state: link
- name: copy the content of the new web site to /var/www/
copy:
src: /home/vagrant/config/static-site/
dest: /var/www/static-site
- name: restart apache2 & enjoy
service:
name: apache2
state: restarted
# https://www.scaleway.com/en/docs/how-to-install-apache-on-ansible/