From 484f2ed82786fda76f3a54f94c527a863274dda3 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sat, 23 Jun 2018 16:27:01 +0200 Subject: [PATCH] add core-networks dns plugin --- defaults/main.yml | 11 +++++++++++ tasks/plugins.yml | 16 ++++++++++++++++ templates/corenetworks/config.ini.j2 | 10 ++++++++++ 3 files changed, 37 insertions(+) create mode 100644 tasks/plugins.yml create mode 100644 templates/corenetworks/config.ini.j2 diff --git a/defaults/main.yml b/defaults/main.yml index af1dca5..44761b7 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -2,10 +2,12 @@ certbot_work_dir: /var/lib/letsencrypt certbot_config_dir: /etc/letsencrypt certbot_log_dir: /var/log/letsencrypt +certbot_plugin_dir: /etc/letsencrypt/plugins certbot_environment: - { name: "{{ certbot_work_dir }}", mode: '0755' } - { name: "{{ certbot_config_dir }}", mode: '0755' } - { name: "{{ certbot_log_dir }}", mode: '0700' } + - { name: "{{ certbot_plugin_dir }}", mode: '0755' } certbot_user: root certbot_preferred_challenges: dns @@ -28,3 +30,12 @@ certbot_command_arguments: # Use a file under /etc/cron.d # Works onyl if certbot_user is root # certbot_cronfile: certbot-letsencrypt + +# Setup manual auth for core-networks api +certbot_core_networks_plugin_enabled: False +certbot_core_networks_plugin_repo: https://git.rknet.org/xoxys/certbot_dns_corenetworks.git +certbot_core_networks_plugin_version: master +certbot_core_networks_api_host: https://beta.api.core-networks.de/ +certbot_core_networks_api_user: myuser +certbot_core_networks_api_password: secure +certbot_core_networks_dns_zone: mydomain.com diff --git a/tasks/plugins.yml b/tasks/plugins.yml new file mode 100644 index 0000000..8a29ce2 --- /dev/null +++ b/tasks/plugins.yml @@ -0,0 +1,16 @@ +--- +- name: Setup core-networks dns plugin + block: + - name: Clone repo to '{{ certbot_plugin_dir }}' + git: + repo: "{{ certbot_core_networks_plugin_repo }}" + dest: "{{ certbot_plugin_dir }}" + version: "{{ certbot_core_networks_plugin_version }}" + + - name: Deploy plugin configuration + template: + src: corenetworks/config.ini.j2 + dest: "~/.certbot_dns_corenetworks/config.ini" + when: certbot_core_networks_plugin_enabled + become: True + become_user: "{{ certbot_user }}" diff --git a/templates/corenetworks/config.ini.j2 b/templates/corenetworks/config.ini.j2 new file mode 100644 index 0000000..a2cb5c6 --- /dev/null +++ b/templates/corenetworks/config.ini.j2 @@ -0,0 +1,10 @@ +#jinja2: trim_blocks: True, lstrip_blocks: True +# {{ ansible_managed }} + +[API] +HOST = {{ certbot_core_networks_api_host }} +USER = {{ certbot_core_networks_api_user }} +PASSWORD = {{ certbot_core_networks_api_password }} + +[DNS] +ZONE = {{ certbot_core_networks_dns_zone }}