certbot-dns-cloudflare/tasks/main.yaml
changeset 174 431c6d5e5dd4
parent 133 effd8e58a796
child 227 2e0366f2dcbe
equal deleted inserted replaced
173:82f2bcbc5aca 174:431c6d5e5dd4
    19     src: "{{certbot_dns_cloudflare_conf}}"
    19     src: "{{certbot_dns_cloudflare_conf}}"
    20     dest: "/etc/letsencrypt/renewal/{{certbot_dns_cloudflare_domain}}.conf"
    20     dest: "/etc/letsencrypt/renewal/{{certbot_dns_cloudflare_domain}}.conf"
    21     mode: "0644"
    21     mode: "0644"
    22     owner: "root"
    22     owner: "root"
    23     group: "root"
    23     group: "root"
       
    24 
       
    25 - name: check if cert exists
       
    26   become: yes
       
    27   stat: path="/etc/letsencrypt/live/{{certbot_dns_cloudflare_domain}}/cert.pem"
       
    28   register: cert
       
    29 
       
    30 - name: run certbot
       
    31   become: yes
       
    32   command: "certbot certonly -n --dns-cloudflare --dns-cloudflare-credentials /etc/letsencrypt/cred.conf -d {{certbot_dns_cloudflare_domain}}"
       
    33   when: not cert.stat.exists
       
    34   changed_when: false