From ae1fa52230cf4922358296aa74a60d9ec52d9fd0 Mon Sep 17 00:00:00 2001 From: Asara Date: Thu, 25 Feb 2021 23:41:37 -0500 Subject: [PATCH] Some wekan fixes, some lnd fixes --- ansible/group_vars/all/main.yml | 6 +++--- ansible/playbooks/lnd.yml | 4 ++-- ansible/roles/lnd/tasks/main.yml | 17 +++++++++++++++-- ansible/roles/wekan/files/wekan.hcl | 12 ++++++++++++ ansible/roles/wekan/handlers/main.yml | 6 ++++++ ansible/roles/wekan/tasks/main.yml | 10 ++++++++++ 6 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 ansible/roles/wekan/files/wekan.hcl create mode 100644 ansible/roles/wekan/handlers/main.yml diff --git a/ansible/group_vars/all/main.yml b/ansible/group_vars/all/main.yml index e0f6ded..d382828 100644 --- a/ansible/group_vars/all/main.yml +++ b/ansible/group_vars/all/main.yml @@ -7,7 +7,7 @@ admin_email_address: amarpreet@minhas.io hashi_arch: amd64 # consul -consul_version: 1.9.1 +consul_version: 1.9.3 consul_domain: masked.name # vault @@ -64,10 +64,10 @@ nomad_version: 1.0.1 nomad_podman_driver_version: 0.1.0 # podman -podman_version: 2.1.1+dfsg1-4 +podman_version: 3.0.1+dfsg1-1 # lnd -lnd_version: 0.11.1-beta +lnd_version: 0.12.1-beta # lego lego_version: 4.1.3 diff --git a/ansible/playbooks/lnd.yml b/ansible/playbooks/lnd.yml index 347216c..9c4d6c8 100644 --- a/ansible/playbooks/lnd.yml +++ b/ansible/playbooks/lnd.yml @@ -1,7 +1,7 @@ --- - hosts: lnd roles: - - role: tor - - role: bitcoind + # - role: tor + # - role: bitcoind - role: lnd ... diff --git a/ansible/roles/lnd/tasks/main.yml b/ansible/roles/lnd/tasks/main.yml index 8a74ff4..aa76ba8 100644 --- a/ansible/roles/lnd/tasks/main.yml +++ b/ansible/roles/lnd/tasks/main.yml @@ -18,13 +18,26 @@ changed_when: False register: lnd_installed_version +- name: stop lnd + systemd: + name: lnd + state: stopped + when: (lnd_binary.stat.exists == False) or (lnd_version != lnd_installed_version.stdout) + - name: update lnd unarchive: src: 'https://github.com/lightningnetwork/lnd/releases/download/v{{ lnd_version }}/lnd-linux-{{ lnd_arch }}-v{{ lnd_version }}.tar.gz' - dest: /home/bitcoind/go/bin/ + dest: /home/bitcoind/go/bin owner: bitcoind group: bitcoind + list_files: True remote_src: True extra_opts: [--strip-components=1] - when: (lnd_binary.stat.exists == False) or (lnd_version != lnd_installed_version) + when: (lnd_binary.stat.exists == False) or (lnd_version != lnd_installed_version.stdout) + +- name: ensure lnd is started + systemd: + name: lnd + state: started + enabled: true ... diff --git a/ansible/roles/wekan/files/wekan.hcl b/ansible/roles/wekan/files/wekan.hcl new file mode 100644 index 0000000..84e7d73 --- /dev/null +++ b/ansible/roles/wekan/files/wekan.hcl @@ -0,0 +1,12 @@ +services { + id = "kanban" + name = "kanban" + port = 3453 + checks = [ + { + args = ["nc", "-z", "-v", "localhost", "3453"] + interval = "5s" + timeout = "20s" + } + ] +} diff --git a/ansible/roles/wekan/handlers/main.yml b/ansible/roles/wekan/handlers/main.yml new file mode 100644 index 0000000..fea9530 --- /dev/null +++ b/ansible/roles/wekan/handlers/main.yml @@ -0,0 +1,6 @@ +--- +- name: reload consul + service: + name: consul + state: reloaded +... diff --git a/ansible/roles/wekan/tasks/main.yml b/ansible/roles/wekan/tasks/main.yml index a5fc346..62b68e6 100644 --- a/ansible/roles/wekan/tasks/main.yml +++ b/ansible/roles/wekan/tasks/main.yml @@ -3,3 +3,13 @@ snap: name: wekan state: present + +- name: add wekan consul service + copy: + src: files/wekan.hcl + dest: /etc/consul.d/wekan.hcl + mode: 0750 + owner: consul + group: consul + notify: reload consul +...