Razique Mahroua
2020-03-18 b85c91a8192593f6b62f93e11c971868964343a9
ansible/roles/host-lets-encrypt-certs-certbot/tasks/main.yml
@@ -11,7 +11,7 @@
      stat:
        path: "/home/{{ ansible_user }}/.aws/credentials"
      register: aws_credentials_result
    - name: Fail if AWS Credentials are not on the host
      fail:
        msg: AWS Credentials are required when requesting certificates for a wildcard domain
@@ -21,7 +21,7 @@
  when: _certbot_dns_provider is match('rfc2136')
  block:
    - name: Verify credential are present on host
      when: _certbot_dns_provider is match('rfc2136')
      when: _certbot_dns_provider is match('rfc2136')
      stat:
        path: /home/{{ _certbot_user }}/.rfc2136.ini
      register: ddns_credentials_result
@@ -80,6 +80,18 @@
    delegate_to: localhost
    register: cache_archive_file
  - name: Ensure Certbot Directories are present
    file:
      name: "{{ item }}"
      state: directory
      owner: "{{ _certbot_remote_dir_owner }}"
      mode: 0775
    loop:
    - "{{ _certbot_dir }}"
    - "{{ _certbot_dir }}/config"
    - "{{ _certbot_dir }}/work"
    - "{{ _certbot_dir }}/logs"
  - name: Restore entire certificate archive
    when:
    - _certbot_use_cache|bool
@@ -95,20 +107,6 @@
    - name: Set _certbot_setup_complete=true
      set_fact:
        _certbot_setup_complete: true
  - name: Ensure Certbot Directories are present
    file:
      name: "{{ item }}"
      state: directory
      owner: "{{ _certbot_remote_dir_owner }}"
      mode: 0775
    loop:
    - "{{ _certbot_dir }}"
    - "{{ _certbot_dir }}/config"
    - "{{ _certbot_dir }}/work"
    - "{{ _certbot_dir }}/logs"
    - "{{ _certbot_dir }}/renewal-hooks"
    - "{{ _certbot_dir }}/renewal-hooks/deploy"
  - name: Request Certificates from Let's Encrypt (force or no cache)
    when: