From 025f21a0568a69fac98620bd6eb0c5dfb06150b3 Mon Sep 17 00:00:00 2001 From: jurgenhaas <juergen@paragon-es.de> Date: Tue, 11 Jun 2019 18:35:59 +0200 Subject: [PATCH] ansible-playbooks/general#85 Linting --- defaults/main.yml | 2 ++ tasks/cert_deploy.yml | 2 +- tasks/install.yml | 4 +-- tasks/main.yml | 62 +++++++++++++++++++++---------------------- 4 files changed, 36 insertions(+), 34 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 88ff8a6..84453eb 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1 +1,3 @@ +--- + letsencrypt_pause_services: [] diff --git a/tasks/cert_deploy.yml b/tasks/cert_deploy.yml index ca228df..dcb4ed6 100644 --- a/tasks/cert_deploy.yml +++ b/tasks/cert_deploy.yml @@ -4,7 +4,7 @@ - block: - name: Deploy Cert - shell: openssl {{ cert.export.type }} -export -out /tmp/{{ cert.domain }}.deploy -inkey privkey.pem -in cert.pem -certfile chain.pem -password pass: + shell: 'openssl {{ cert.export.type }} -export -out /tmp/{{ cert.domain }}.deploy -inkey privkey.pem -in cert.pem -certfile chain.pem -password pass:' args: chdir: /etc/letsencrypt/live/{{ cert.domain }} diff --git a/tasks/install.yml b/tasks/install.yml index 7173613..fcd8655 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -21,8 +21,8 @@ - name: Force certbot to use Python 3 lineinfile: path: '{{ item }}' - regexp: ^#!/usr/bin/python$ - line: #!/usr/bin/python3 + regexp: '^#!/usr/bin/python$' + line: '#!/usr/bin/python3' with_items: - /usr/local/bin/certbot - /usr/bin/certbot diff --git a/tasks/main.yml b/tasks/main.yml index 9e5a7d0..c4c3663 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -9,36 +9,36 @@ - block: - - name: Ensure LetsEncrypt Directory - file: - path: /etc/letsencrypt - state: directory - - - name: Check Existing Certs - stat: - path: /etc/letsencrypt/live - register: letsencrypt_certs_available - failed_when: no - changed_when: no - tags: - - renew - - - import_tasks: install.yml - - - include_tasks: cert.yml - with_items: '{{ letsencrypt_certificates|default([]) }}' - loop_control: - loop_var: domain - tags: - - Certs - - - import_tasks: renew.yml - when: letsencrypt_certs_available is defined and letsencrypt_certs_available.stat.exists and (proxy_active is not defined or proxy_active) - tags: - - renew - - - import_tasks: ../../haproxy/tasks/proxypool.yml - tags: - - renew + - name: Ensure LetsEncrypt Directory + file: + path: /etc/letsencrypt + state: directory + + - name: Check Existing Certs + stat: + path: /etc/letsencrypt/live + register: letsencrypt_certs_available + failed_when: no + changed_when: no + tags: + - renew + + - import_tasks: install.yml + + - include_tasks: cert.yml + with_items: '{{ letsencrypt_certificates|default([]) }}' + loop_control: + loop_var: domain + tags: + - Certs + + - import_tasks: renew.yml + when: letsencrypt_certs_available is defined and letsencrypt_certs_available.stat.exists and (proxy_active is not defined or proxy_active) + tags: + - renew + + - import_tasks: ../../haproxy/tasks/proxypool.yml + tags: + - renew when: not excluded_roles or "letsencrypt" not in excluded_roles -- GitLab