diff --git a/roles/mastodon-nginx/tasks/install.yml b/roles/mastodon-nginx/tasks/install.yml index cf43dc6..56b21f7 100644 --- a/roles/mastodon-nginx/tasks/install.yml +++ b/roles/mastodon-nginx/tasks/install.yml @@ -7,6 +7,6 @@ - name: Install acme.sh shell: wget -O - https://get.acme.sh | sh - name: Generate certificate using acme.sh - shell: acme.sh --issue --nginx -d {{ LOCAL_DOMAIN }} + shell: /root/.acme.sh/acme.sh --issue --nginx -d {{ LOCAL_DOMAIN }} - name: Install certificate in storage directory - shell: acme.sh --install-cert -d {{ LOCAL_DOMAIN }} --key-file /etc/ssl/letsencrypt/{{ LOCAL_DOMAIN }}.pem --fullchain-file /etc/ssl/letsencrypt/{{ LOCAL_DOMAIN }}.crt --reloadcmd "service nginx force-reload" + shell: /root/.acme.sh/acme.sh --install-cert -d {{ LOCAL_DOMAIN }} --key-file /etc/ssl/letsencrypt/{{ LOCAL_DOMAIN }}.pem --fullchain-file /etc/ssl/letsencrypt/{{ LOCAL_DOMAIN }}.crt --reloadcmd "service nginx force-reload" diff --git a/roles/mastodon-nginx/tasks/main.yml b/roles/mastodon-nginx/tasks/main.yml index 6c04332..f08d483 100644 --- a/roles/mastodon-nginx/tasks/main.yml +++ b/roles/mastodon-nginx/tasks/main.yml @@ -1,11 +1,10 @@ --- # This role install nginx, configures it -- name: Install nginx and certbot +- name: Install nginx apt: name={{ item }} state=latest update_cache=yes with_items: - nginx - - letsencrypt - name: Remove default nginx config in sites-enabled file: path: /etc/nginx/sites-enabled/default @@ -19,11 +18,6 @@ src: /etc/nginx/sites-available/{{ LOCAL_DOMAIN }}.conf dest: /etc/nginx/sites-enabled/{{ LOCAL_DOMAIN }}.conf state: link -- name: Copy and enable Let's Encrypt renew script - copy: - src: letsencrypt-renew.sh - dest: /etc/cron.daily/letsencrypt-renew.sh - mode: 0700 - name: Run nginx install tasks include_tasks: install.yml when: install is defined