aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/letsencrypt/tasks/digitalocean.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/letsencrypt/tasks/digitalocean.yml')
-rw-r--r--roles/letsencrypt/tasks/digitalocean.yml8
1 files changed, 4 insertions, 4 deletions
diff --git a/roles/letsencrypt/tasks/digitalocean.yml b/roles/letsencrypt/tasks/digitalocean.yml
index 30a7a9c..032774f 100644
--- a/roles/letsencrypt/tasks/digitalocean.yml
+++ b/roles/letsencrypt/tasks/digitalocean.yml
@@ -2,22 +2,22 @@
become: true
block:
- name: Prompt for token
+ when: |
+ lookup('env', 'DIGITALOCEAN_TOKEN') | length <= 0
ansible.builtin.pause:
prompt: |
Enter your API token:
echo: false
register: letsencrypt_do_token
- when:
- - lookup('env', 'DIGITALOCEAN_TOKEN') | length <= 0
- name: Set token as fact
ansible.builtin.set_fact:
letsencrypt_do_token: "{{ letsencrypt_do_token.user_input | default(lookup('env', 'DIGITALOCEAN_TOKEN')) }}"
- name: Fail if token is invalid
+ when: letsencrypt_do_token | length == 0
ansible.builtin.fail:
msg: 'DigitalOcean token is invalid'
- when: letsencrypt_do_token | length == 0
- name: Configure certbot.ini
ansible.builtin.template:
@@ -25,4 +25,4 @@
dest: '{{ letsencrypt_credentials_ini }}'
owner: root
group: root
- mode: '600'
+ mode: '0600'