Skip to content
Snippets Groups Projects
Commit 9904f73f authored by jurgenhaas's avatar jurgenhaas
Browse files

ansible-playbooks/general#72 Always use import_tasks or include_tasks instead of just include

parent 05b6d41f
No related branches found
No related tags found
No related merge requests found
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
- block: - block:
- include: install.yml - import_tasks: install.yml
- include: configure.yml - import_tasks: configure.yml
tags: 'Config' tags: 'Config'
when: '"haproxy" not in excluded_roles' when: '"haproxy" not in excluded_roles'
...@@ -16,20 +16,20 @@ ...@@ -16,20 +16,20 @@
- block: - block:
- name: "Install Certs" - name: "Install Certs"
include: '../../letsencrypt/tasks/cert.yml' include_tasks: '../../letsencrypt/tasks/cert.yml'
with_items: '{{ proxy_certificates|default([]) }}' with_items: '{{ proxy_certificates|default([]) }}'
loop_control: loop_control:
loop_var: domain loop_var: domain
when: domain.letsencrypt|default(false) and domain.active|default(true) when: domain.letsencrypt|default(false) and domain.active|default(true)
- name: "Renew Existing Cert" - name: "Renew Existing Cert"
include: '../../letsencrypt/tasks/renew.yml' import_tasks: '../../letsencrypt/tasks/renew.yml'
- name: "Build HaProxy Certs" - name: "Build HaProxy Certs"
include: 'buildcerts.yml' import_tasks: 'buildcerts.yml'
tags: 'Certs' tags: 'Certs'
when: 'proxy_active and "letsencrypt" not in excluded_roles' when: 'proxy_active and "letsencrypt" not in excluded_roles'
- include_tasks: 'proxypool.yml' - import_tasks: 'proxypool.yml'
tags: 'Certs' tags: 'Certs'
--- ---
# file: roles/haproxy/tasks/proxypool.yml # file: roles/haproxy/tasks/proxypool.yml
- name: "Set directory permissions to current user" - block:
file:
path: '/etc/letsencrypt'
owner: '{{ ansible_env.SUDO_USER }}'
recurse: yes
tags: 'Certs'
when: 'proxy_active is defined and proxy_active and "letsencrypt" not in excluded_roles'
- name: "Pull Certs from active Proxy" - name: "Set directory permissions to current user"
include: 'pullcerts.yml' file:
tags: 'Certs' path: '/etc/letsencrypt'
when: 'proxy_active is defined and not proxy_active and "letsencrypt" not in excluded_roles' owner: '{{ ansible_env.SUDO_USER }}'
recurse: yes
when: 'proxy_active is defined and proxy_active and "letsencrypt" not in excluded_roles'
- name: "Pull Certs from active Proxy"
import_tasks: 'pullcerts.yml'
when: 'proxy_active is defined and not proxy_active and "letsencrypt" not in excluded_roles'
- name: "Set directory permissions to root"
file:
path: '/etc/letsencrypt'
owner: 'root'
recurse: yes
when: 'proxy_active is defined and proxy_active and "letsencrypt" not in excluded_roles'
- name: "Set directory permissions to root"
file:
path: '/etc/letsencrypt'
owner: 'root'
recurse: yes
tags: 'Certs' tags: 'Certs'
when: 'proxy_active is defined and proxy_active and "letsencrypt" not in excluded_roles'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment