diff --git a/defaults/main.yml b/defaults/main.yml index 0c6e4a7..b7231ca 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -10,7 +10,4 @@ _consul: use_dnsmasq_forwarding: true download: consul_url: "https://releases.hashicorp.com/consul/1.12.9/consul_1.12.9_linux_amd64.zip" - consul_template_url: "https://releases.hashicorp.com/consul-template/0.19.0/consul-template_0.19.0_linux_amd64.zip" - template: - config_dir: "/etc/consul-template.d" logfile: "/var/log/consul.log" diff --git a/tasks/consul_template.yml b/tasks/consul_template.yml deleted file mode 100644 index da03d8c..0000000 --- a/tasks/consul_template.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -# vim: set ft=ansible: -- name: Install Consul Template - ansible.builtin.unarchive: - remote_src: yes - src: "{{ item }}" - dest: "/usr/local/bin" - with_items: - - "{{ _consul.download.consul_template_url }}" - -- name: Create Consul Template Config Directory - ansible.builtin.file: - name: "{{ _consul.template.config_dir }}" - state: directory - owner: "root" - group: "consul" - mode: "0755" - -- name: Create Consul Templates Directory - ansible.builtin.file: - name: "{{ _consul.template.config_dir }}/templates" - state: directory - owner: "root" - group: "consul" - mode: "0755" - -- name: Create Consul Template systemd Script - ansible.builtin.template: - src: "{{ item }}.j2" - dest: "/{{ item }}" - owner: "root" - group: "root" - mode: "0644" - with_items: - - "etc/systemd/system/consul-template.service" - -- name: Disable Consul Template Service autostart - ansible.builtin.service: - name: "{{ item }}" - enabled: no - with_items: - - "consul-template" diff --git a/tasks/main.yml b/tasks/main.yml index 80bd08b..aff9d1f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -79,8 +79,3 @@ name: dnsmasq state: restarted when: dnsmasq_consul is changed - -# Install Consul Template only when requested -- name: Install and configure Consul Template - ansible.builtin.include_tasks: consul_template.yml - when: _consul.template.install | default('false') | bool diff --git a/templates/etc/systemd/system/consul-template.service.j2 b/templates/etc/systemd/system/consul-template.service.j2 deleted file mode 100644 index f30e694..0000000 --- a/templates/etc/systemd/system/consul-template.service.j2 +++ /dev/null @@ -1,19 +0,0 @@ -[Unit] -Description="HashiCorp Consul" -Documentation=https://www.consul.io/ -Requires=network-online.target -After=network-online.target - -[Service] -User=consul -Group=consul -ExecStart=/usr/local/bin/consul-template -config={{ _consul.template.config_dir }} -ExecReload=/usr/local/bin/consul-template reload -KillMode=process -Restart=on-failure -LimitNOFILE=65536 -StandardOutput=file:/var/log/{{ _consul.service_name }}.log -StandardError=inherit - -[Install] -WantedBy=multi-user.target \ No newline at end of file