ansible-roles/apache/tasks/auth.yml
Jérémy Lecour 00fe225a3c
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |2615|7|2608|177|:+1: Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/278//ansiblelint">Evolix » ansible-roles » unstable #278</a>
gitea/ansible-roles/pipeline/head This commit looks good
force: [yes,no] → force [true,false]
2023-06-28 13:25:30 +02:00

57 lines
1.3 KiB
YAML

---
- name: Init ipaddr_whitelist.conf file
ansible.builtin.copy:
src: ipaddr_whitelist.conf
dest: /etc/apache2/ipaddr_whitelist.conf
owner: root
group: root
mode: "0640"
force: false
tags:
- apache
- name: Load IP whitelist task
ansible.builtin.import_tasks: ip_whitelist.yml
- name: include private IP whitelist for server-status
ansible.builtin.lineinfile:
dest: /etc/apache2/mods-available/status.conf
line: " include /etc/apache2/ipaddr_whitelist.conf"
insertafter: 'SetHandler server-status'
state: present
tags:
- apache
- name: Copy private_htpasswd
ansible.builtin.copy:
src: private_htpasswd
dest: /etc/apache2/private_htpasswd
owner: root
group: root
mode: "0640"
force: false
notify: reload apache
tags:
- apache
- name: add user:pwd to private htpasswd
ansible.builtin.lineinfile:
dest: /etc/apache2/private_htpasswd
line: "{{ item }}"
state: present
loop: "{{ apache_private_htpasswd_present }}"
notify: reload apache
tags:
- apache
- name: remove user:pwd from private htpasswd
ansible.builtin.lineinfile:
dest: /etc/apache2/private_htpasswd
line: "{{ item }}"
state: absent
loop: "{{ apache_private_htpasswd_absent }}"
notify: reload apache
tags:
- apache