zen_rev_proxy/tasks/main.yml

69 lines
1.4 KiB
YAML

---
- name: Install proxy packages
ansible.builtin.package:
name: "{{ proxy_package_list }}"
state: present
tags: always
- name: Enable nginx at boot time
ansible.builtin.service:
name: nginx
enabled: true
tags: always
when: ansible_virtualization_type != "docker"
- name: Clean conf.d
ansible.builtin.file:
path: "{{ proxy_site_conf_dir }}"
state: absent
tags: ['clean_deploy', 'never']
- name: Create conf.d directory
ansible.builtin.file:
path: "{{ proxy_site_conf_dir }}"
state: directory
mode: "0755"
tags: always
- name: Create log directory
ansible.builtin.file:
path: "{{ proxy_site_log_path }}"
state: directory
mode: "0755"
tags: always
## TODO: fix the perms on ssl certs!!@*&!@^&*
- name: Clone ssl certs
ansible.builtin.git:
repo: "{{ ssl_repo }}"
dest: "{{ proxy_site_ssl_directory }}"
version: "{{ ssl_repo_branch }}"
accept_newhostkey: true
tags: always
notify: restart nginx
- name: Write configuration file(s)
ansible.builtin.template:
src: proxy_site.j2
dest: "{{ proxy_site_conf_dir }}/{{ item.key }}.conf"
mode: "0644"
with_dict:
- "{{ proxy_sites }}"
tags: always
notify: restart nginx
- name: Start nginx
ansible.builtin.service:
name: nginx
state: started
tags: always
when: ansible_virtualization_type != "docker"