1
1
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2025-01-18 08:06:16 +01:00
infrastructure/roles/maintenance/tasks/main.yml
Leonidas Spyropoulos 3ac1bac037
ansible-lint: Forbidden implicit octal value 'xxxx'
Convert the permissions to strings to avoid octal interpretation.

Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2023-02-18 20:15:54 +02:00

42 lines
1.3 KiB
YAML

- name: Create the maintenance logs dir
file: path={{ maintenance_logs_dir }} state=directory owner=root group=root mode=0755
- name: Create the maintenance http dir
file: path={{ maintenance_http_dir }} state=directory owner=root group=root mode=0755
- name: Create the service http root dir
file: path={{ maintenance_http_dir }}/{{ service_domain }} state=directory owner=root group=root mode=0755
when: maintenance is defined and maintenance | bool
- name: Set up nginx maintenance mode
template:
src: nginx-maintenance.conf.j2
dest: "{{ service_nginx_conf }}"
owner: root
group: root
mode: '0644'
notify: Reload nginx
when: service_nginx_template is not defined and maintenance is defined and maintenance | bool
- name: Set up custom nginx maintenance mode
template:
src: "{{ service_nginx_template }}"
dest: "{{ service_nginx_conf }}"
owner: root
group: root
mode: '0644'
notify: Reload nginx
when: service_nginx_template is defined and maintenance is defined and maintenance | bool
- name: Create the 503 html file
template:
src: 503.html.j2
dest: "{{ maintenance_http_dir }}/{{ service_domain }}/503.html"
owner: root
group: root
mode: '0644'
when: maintenance is defined and maintenance | bool
- name: Force reload nginx
meta: flush_handlers