diff --git a/defaults/main.yml b/defaults/main.yml index 48155fa..7630a15 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -7,3 +7,8 @@ certbot_environment: - { name: "{{ certbot_config_dir }}", mode: '0755' } - { name: "{{ certbot_log_dir }}", mode: '0700' } certbot_user: root + +certbot_preferred_challenges: dns +certbot_server: https://acme-v02.api.letsencrypt.org/directory +certbot_email: mail@example.com +certbot_rsa_key_size: 4096 diff --git a/tasks/install.yml b/tasks/install.yml index 169061f..0ea2472 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -24,7 +24,7 @@ - name: Deploy config file template: - src: etc/ssh/sshd_config.j2 - dest: /etc/ssh/sshd_config + src: conf/cli.ini.j2 + dest: " {{ certbot_config_dir }} " become: True become_user: "{{ certbot_user }}" diff --git a/templates/config/cli.ini.j2 b/templates/config/cli.ini.j2 new file mode 100644 index 0000000..824d242 --- /dev/null +++ b/templates/config/cli.ini.j2 @@ -0,0 +1,15 @@ +#jinja2: trim_blocks: True, lstrip_blocks: True +# {{ ansible_managed }} + +{% if certbot_preferred_challenges is defined %} +preferred-challenges = {{ certbot_preferred_challenges }} +{% endif %} +{% if certbot_server is defined %} +server = {{ certbot_server }} +{% endif %} +{% if certbot_email is defined %} +email = {{ certbot_email }} +{% endif %} +{% if certbot_rsa_key_size is defined %} +rsa-key-size = {{ certbot_rsa_key_size }} +{% endif %}