1 #####################################
2 ### someone's ansible provisioner ###
3 #####################################
4 # Part of: https://git.somenet.org/root/pub/somesible.git
5 # 2017-2024 by someone <someone@somenet.org>
8 - name: append {{letsencrypt_cert_domain}} to domains.txt
10 line: "{{letsencrypt_cert_domain}} {{letsencrypt_cert_domain_alias}}"
11 path: "/etc/dehydrated/domains.txt"
16 when: letsencrypt_cert_domain != ""
19 - name: create domains.txt.ansible.tmp for {{letsencrypt_cert_domain}}
21 content: "{{letsencrypt_cert_domain}} {{letsencrypt_cert_domain_alias}}\n"
22 dest: "/etc/dehydrated/domains.txt.ansible.tmp"
27 when: letsencrypt_cert_domain != ""
30 - name: request cert for {{letsencrypt_cert_domain}}
31 shell: "/usr/bin/dehydrated -c"
33 creates: "/etc/ssl/letsencrypt/{{letsencrypt_cert_domain}}/cert.pem"
35 DOMAINS_TXT: '/etc/dehydrated/domains.txt.ansible.tmp'
37 become_user: "letsencrypt"
39 when: letsencrypt_cert_domain != ""
42 - name: request cert-rsa for {{letsencrypt_cert_domain}}
43 shell: "/usr/bin/dehydrated -f /etc/dehydrated/config-rsa -c"
45 creates: "/etc/ssl/letsencrypt-rsa/{{letsencrypt_cert_domain}}/cert.pem"
47 DOMAINS_TXT: '/etc/dehydrated/domains.txt.ansible.tmp'
49 become_user: "letsencrypt"
51 when: letsencrypt_cert_domain != ""
54 - name: fix permissions for /etc/ssl/letsencrypt/{{letsencrypt_cert_domain}}
56 path: "/etc/ssl/letsencrypt/{{letsencrypt_cert_domain}}"
59 mode: "u+rwX,g+rX,o-rwx"
62 when: letsencrypt_cert_domain != ""
65 - name: fix permissions for /etc/ssl/letsencrypt-rsa/{{letsencrypt_cert_domain}}
67 path: "/etc/ssl/letsencrypt-rsa/{{letsencrypt_cert_domain}}"
70 mode: "u+rwX,g+rX,o-rwx"
73 when: letsencrypt_cert_domain != ""
76 - name: remove domains.txt.ansible.tmp
78 path: "/etc/dehydrated/domains.txt.ansible.tmp"