ansible-role-apache/tasks/configuration.yml

46 lines
1.2 KiB
YAML
Raw Normal View History

---
- name: "configuration | Deaktiviere Server-Tokens"
ansible.builtin.lineinfile:
2021-07-28 03:11:08 +02:00
path: /etc/apache2/conf-enabled/security.conf
regexp: '^ServerTokens OS'
line: ServerTokens Prod
notify: reload apache2
- name: "configuration | Deaktiviere access-Logs"
ansible.builtin.command:
cmd: a2disconf other-vhosts-access-log
removes: /etc/apache2/conf-enabled/other-vhosts-access-log.conf
2021-07-28 03:11:08 +02:00
notify: reload apache2
2021-07-28 09:56:47 +02:00
- name: "apache | Generiere Diffie-Hellman-Parameter"
openssl_dhparam:
path: "{{ dhparams_path }}"
- name: "configuration | Kopiere Dateien"
ansible.builtin.copy:
2021-07-28 09:56:47 +02:00
src: "{{ item }}"
dest: "/etc/apache2/conf-available/{{ item }}"
mode: 0644
loop:
- add-headers.conf
- letsencrypt.conf
- sao-cache.conf
- name: "configuration | Kopiere SSL-Konfiguration"
ansible.builtin.template:
src: ssl.conf
dest: /etc/apache2/conf-available/ssl.conf
mode: 0644
- name: "configuration | Aktiviere Konfiguration"
ansible.builtin.command:
cmd: "a2enmod {{ item }}"
creates: "/etc/apache2/conf-enabled/{{ item }}"
notify: reload apache2
when: "'extern_hosts' in group_names"
2021-07-28 09:56:47 +02:00
loop:
- add-headers.conf
2021-07-28 11:24:28 +02:00
- letsencrypt.conf
2022-07-26 17:45:32 +02:00
- sao-cache.conf
2021-07-28 09:56:47 +02:00
- ssl.conf