Files
ansible-directadmin/tasks/letsencrypt.yml
hyperized 160620477e Bring role up to spec (2.5+, Debian 9) and introduce LetsEncrypt support (#5)
* Bring role up to spec (2.5+) and introduce LetsEncrypt support
* Add Debian 9 support and fix script args chdir
* Use correct schema for travis and use command instead of script
* Make use of requirements.txt for build and fix syntax
* Got better at reading the docs now
* Minor improvements
2018-09-17 15:12:03 +02:00

23 lines
836 B
YAML

---
- name: execute LetsEncrypt setup script
command: letsencrypt.sh request_single {{ directadmin_hostname }} 4096
args:
chdir: /usr/local/directadmin/scripts/
register: directadmin_letsencrypt_output
- debug:
var: directadmin_letsencrypt_output.stdout_lines
- name: enable SSL with LetsEncrypt for DirectAdmin
lineinfile:
path: directadmin_config_path
regexp: item.regexp
line: item.line
with_items:
- { regexp: '^SSL\=0' , line: 'SSL=1' }
- { regexp: '^carootcert=' , line: 'carootcert=/usr/local/directadmin/conf/carootcert.pem' }
- { regexp: '^force_hostname=' , line: "force_hostname={{ directadmin_hostname }}" }
- { regexp: '^ssl_redirect_host=' , line: "ssl_redirect_host={{ directadmin_hostname }}" }
- { regexp: '^letsencrypt=' , line: "letsencrypt=1" }
notify:
- restart directadmin