role-certbot/tasks/generate_cert.yml
2024-10-07 22:38:31 -05:00

10 lines
383 B
YAML

# generate_cert.yml
---
- name: check if privkey exists
ansible.builtin.command: '[ -f "/etc/letsencrypt/live/{{ item.domain }}/README" ]'
register: result
ignore_errors: true
- name: generate certificate
ansible.builtin.command: 'certbot certonly --standalone --preferred-challenge http-01 -d {{ item.domain }} -m ejparker@actcur.com --agree-tos'
when: result is failure