diff --git a/plays/lib/certs.yml b/plays/lib/certs.yml deleted file mode 100644 index 529d312..0000000 --- a/plays/lib/certs.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- name: Setup lets encrypt certificates - shell: "dokku letsencrypt {{ app }}" - args: - creates: "/home/dokku/{{ app }}/letsencrypt/certs" - -- name: Setup lets encrypt certificates renew cron job - shell: dokku letsencrypt:cron-job --add - args: - creates: "/home/dokku/{{ app }}/letsencrypt/cron-job" diff --git a/plays/lib/domain.yml b/plays/lib/domain.yml index 7b7b2d6..120067e 100644 --- a/plays/lib/domain.yml +++ b/plays/lib/domain.yml @@ -6,18 +6,3 @@ - "{{ domain }}" state: present when: domain is defined - -- name: Provide information on domain configuration - debug: - msg: - - "Dedicated domain discovered for the deployment of {{ app }}" - - "Your application will be available at https://{{ domain }}" - when: domain is defined - -- name: Provide information on sub-domain configuration - debug: - msg: - - "No dedicated domain configured for the deployment of {{ app }}" - - "Dokku will provide a sub-domain configuration" - - "Your application will be available at https://{{ app }}.{{ dokku_hostname }}" - when: domain is not defined diff --git a/plays/lib/https.yml b/plays/lib/https.yml index ff97e8a..f7a45c8 100644 --- a/plays/lib/https.yml +++ b/plays/lib/https.yml @@ -1,4 +1,14 @@ --- +- name: Setup lets encrypt certificates + shell: "dokku letsencrypt {{ app }}" + args: + creates: "/home/dokku/{{ app }}/letsencrypt/certs" + +- name: Setup lets encrypt certificates renew cron job + shell: dokku letsencrypt:cron-job --add + args: + creates: "/home/dokku/{{ app }}/letsencrypt/cron-job" + - name: Set HTTP 443 port dokku_ports: app: "{{ app }}" diff --git a/plays/post_deploy.yml b/plays/post_deploy.yml index 6a20a79..33268f1 100644 --- a/plays/post_deploy.yml +++ b/plays/post_deploy.yml @@ -13,11 +13,9 @@ - name: Include http tasks include: ./lib/http.yml - - name: Include certs tasks - include: ./lib/certs.yml - - name: Include https tasks include: ./lib/https.yml + when: https is defined and https == true - name: Include proxy tasks include: ./lib/proxy.yml