lnd/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Mon, 07 Oct 2024 15:26:03 -0500
changeset 35 f7dc2fa74e74
parent 28 c94c54d5e61b
permissions -rw-r--r--
Version updates
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     1
---
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     2
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     3
- name: add lnd user
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     4
  become: yes
21
bf53e2eb4d30 Updated versions.
Luke Hoersten <luke@hoersten.org>
parents: 10
diff changeset
     5
  user: name="{{lnd_user}}" shell="/bin/false" system="yes"
5
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     6
10
26ed67281db6 Updated bitcoind and lnd.
Luke Hoersten <luke@hoersten.org>
parents: 9
diff changeset
     7
- name: download lnd
5
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     8
  become: yes
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     9
  unarchive:
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    10
    remote_src: yes
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    11
    src: "{{item.url}}"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    12
    dest: "/tmp"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    13
    creates: "/tmp/{{item.tar_name}}/"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    14
  loop:
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    15
    - url: "{{lnd_url}}"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    16
      tar_name: "{{lnd_tar_name}}"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    17
    - url: "{{lndconnect_url}}"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    18
      tar_name: "{{lndconnect_tar_name}}"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    19
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    20
- name: install lnd
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    21
  become: yes
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    22
  copy:
27
3abee15898bb Updated bitcoind and lnd versions and added a lnd hex macaroon script for Zeus.
Luke Hoersten <luke@hoersten.org>
parents: 21
diff changeset
    23
    src: "{{item}}"
10
26ed67281db6 Updated bitcoind and lnd.
Luke Hoersten <luke@hoersten.org>
parents: 9
diff changeset
    24
    dest: "/usr/local/bin/"
5
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    25
    remote_src: yes
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    26
    owner: "root"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    27
    group: "root"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    28
    mode: "0755"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    29
  loop:
27
3abee15898bb Updated bitcoind and lnd versions and added a lnd hex macaroon script for Zeus.
Luke Hoersten <luke@hoersten.org>
parents: 21
diff changeset
    30
    - "/tmp/{{lnd_tar_name}}/lnd"
28
c94c54d5e61b lndcli was renamed to lncli.
Luke Hoersten <luke@hoersten.org>
parents: 27
diff changeset
    31
    - "/tmp/{{lnd_tar_name}}/lncli"
27
3abee15898bb Updated bitcoind and lnd versions and added a lnd hex macaroon script for Zeus.
Luke Hoersten <luke@hoersten.org>
parents: 21
diff changeset
    32
    - "/tmp/{{lndconnect_tar_name}}/lndconnect"
10
26ed67281db6 Updated bitcoind and lnd.
Luke Hoersten <luke@hoersten.org>
parents: 9
diff changeset
    33
  notify: restart lnd
5
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    34
27
3abee15898bb Updated bitcoind and lnd versions and added a lnd hex macaroon script for Zeus.
Luke Hoersten <luke@hoersten.org>
parents: 21
diff changeset
    35
- name: install lnd-hex-macaroon script
3abee15898bb Updated bitcoind and lnd versions and added a lnd hex macaroon script for Zeus.
Luke Hoersten <luke@hoersten.org>
parents: 21
diff changeset
    36
  become: yes
3abee15898bb Updated bitcoind and lnd versions and added a lnd hex macaroon script for Zeus.
Luke Hoersten <luke@hoersten.org>
parents: 21
diff changeset
    37
  copy:
3abee15898bb Updated bitcoind and lnd versions and added a lnd hex macaroon script for Zeus.
Luke Hoersten <luke@hoersten.org>
parents: 21
diff changeset
    38
    src: "lnd-hex-macaroon"
3abee15898bb Updated bitcoind and lnd versions and added a lnd hex macaroon script for Zeus.
Luke Hoersten <luke@hoersten.org>
parents: 21
diff changeset
    39
    dest: "/usr/local/bin/"
3abee15898bb Updated bitcoind and lnd versions and added a lnd hex macaroon script for Zeus.
Luke Hoersten <luke@hoersten.org>
parents: 21
diff changeset
    40
    owner: "root"
3abee15898bb Updated bitcoind and lnd versions and added a lnd hex macaroon script for Zeus.
Luke Hoersten <luke@hoersten.org>
parents: 21
diff changeset
    41
    group: "root"
3abee15898bb Updated bitcoind and lnd versions and added a lnd hex macaroon script for Zeus.
Luke Hoersten <luke@hoersten.org>
parents: 21
diff changeset
    42
    mode: "0755"
3abee15898bb Updated bitcoind and lnd versions and added a lnd hex macaroon script for Zeus.
Luke Hoersten <luke@hoersten.org>
parents: 21
diff changeset
    43
5
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    44
- name: create lnd data dir
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    45
  become: yes
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    46
  file:
9
ddf84e986362 Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents: 6
diff changeset
    47
    path: "{{item.path}}"
5
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    48
    state: "directory"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    49
    owner: "{{lnd_user}}"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    50
    group: "{{lnd_user}}"
9
ddf84e986362 Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents: 6
diff changeset
    51
    mode: "{{item.mode}}"
6
e0672e50e2c5 Moved from with_items to loop.
Luke Hoersten <luke@hoersten.org>
parents: 5
diff changeset
    52
  loop:
9
ddf84e986362 Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents: 6
diff changeset
    53
    - { path: "{{lnd_data_dir}}", mode: "0750" }
ddf84e986362 Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents: 6
diff changeset
    54
    - { path: "{{lnd_log_dir}}", mode: "0750" }
ddf84e986362 Added bitcoind-prometheus-exporter role.
Luke Hoersten <luke@hoersten.org>
parents: 6
diff changeset
    55
    - { path: "{{lnd_conf_dir}}", mode: "0755" }
5
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    56
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    57
- name: configure lnd
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    58
  become: yes
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    59
  template:
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    60
    src: "lnd.conf.j2"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    61
    dest: "{{lnd_conf_dir}}/lnd.conf"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    62
    owner: "{{lnd_user}}"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    63
    group: "{{lnd_user}}"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    64
    mode: "0644"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    65
  notify: restart lnd
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    66
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    67
- name: install lnd service
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    68
  become: yes
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    69
  template:
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    70
    src: "lnd.service.j2"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    71
    dest: "/lib/systemd/system/lnd.service"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    72
    mode: "0644"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    73
  notify: restart lnd
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    74
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    75
- name: ensure lnd is started
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    76
  become: yes
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    77
  systemd: service="lnd.service" enabled="yes" state="started" daemon_reload="yes"