Is based on beautiful script https://github.com/lukas2511/letsencrypt.sh
Example of use:
- hosts: dev vars: - root_dir: "{{playbook_dir}}" - my_domains: - { names: "voronenko.net www.voronenko.net", nginx_config: "/etc/nginx/sites-available/voronenko_net" } pre_tasks: - debug: msg="Pre tasks section" roles: - { role: "sa-lets-encrypt", le_domains: "{{my_domains}}", option_run_once: true, option_setup_cron: true } tasks: - debug: msg="Tasks section"
Advanced example:
--- - hosts: www vars: - root_dir: "{{playbook_dir}}" - my_domains: - { names: "voronenko.net www.voronenko.net", nginx_config: "/etc/nginx/sites-available/voronenko_net" } pre_tasks: - debug: msg="Pre tasks section" roles: - { role: "sa-nginx" } - { role: "sa-include", include_file: "{{root_dir}}/demosite.yml" } - { role: "sa-lets-encrypt", le_domains: "{{my_domains}}", # le_ca: "https://acme-staging.api.letsencrypt.org/directory", option_run_once: true, option_setup_cron: true } tasks: - debug: msg="Tasks section"
See standalone example in box-example folder.