diff --git a/ansible/certbot.yml b/ansible/certbot.yml index c4f7817c..84538980 100644 --- a/ansible/certbot.yml +++ b/ansible/certbot.yml @@ -1,27 +1,30 @@ --- - name: Check if the file already exists stat: path: /etc/letsencrypt/live/{{ hostname }} register: stat_result - name: certbot block: - name: stop firewall ansible.builtin.service: name: firewalld state: stopped - name: Create letsencrypt certificate shell: certbot certonly --standalone -d {{ hostname }} --staple-ocsp -m test@{{ hostname }} --agree-tos args: creates: /etc/letsencrypt/live/{{ hostname }} - - name: chmod letsencrypt certificate - shell: chmod 755 /etc/letsencrypt/{live, archive} + - name: chmod letsencrypt certificate live + shell: chmod 755 /etc/letsencrypt/live + + - name: chmod letsencrypt certificate archive + shell: chmod 755 /etc/letsencrypt/archive - name: start firewall ansible.builtin.service: name: firewalld state: started when: not stat_result.stat.exists