summaryrefslogtreecommitdiff
path: root/roles/apache2/tasks/main.yml
blob: a8d7820bb8f67a56d88187438e998c1cf1f0eeab (plain)
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
- name: "create testuser account"
  user:
    name: testuser
    password_lock: yes

- name: "allow deployer access to testuser via ssh"
  authorized_key:
    user: testuser
    key: "{{ deployer_ssh_pub }}"
    exclusive: yes

- name: "create /srv/http"
  file:
    state: directory
    path: /srv/http
    owner: testuser
    group: testuser

- name: "install apache2"
  apt:
    name: apache2

- name: "add virtual host for /srv/http"
  copy:
    src: testenv.conf
    dest: /etc/apache2/sites-available/testenv.conf

- name: "enable virtual host"
  shell: |
    a2ensite testenv

- name: "restart apache2"
  systemd:
    name: apache2
    state: restarted