infra/ansible/roles/lnd/tasks/main.yml

31 lines
842 B
YAML

---
- name: ensure go/bin dir exists for bitcoind user
file:
path: /home/bitcoind/go/bin
state: directory
owner: bitcoind
group: bitcoind
mode: 0750
- name: check if lnd is installed
stat:
path: /home/bitcoind/go/bin/lnd
register: lnd_binary
- name: check lnd version
shell: /home/bitcoind/go/bin/lnd --version | cut -d ' ' -f3
when: lnd_binary.stat.exists
changed_when: False
register: lnd_installed_version
- 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/
owner: bitcoind
group: bitcoind
remote_src: True
extra_opts: [--strip-components=1]
when: (lnd_binary.stat.exists == False) or (lnd_version != lnd_installed_version)
...