lnd/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Tue, 12 May 2020 19:47:57 -0500
changeset 5 5873b7e583d7
child 6 e0672e50e2c5
permissions -rw-r--r--
Removed btcd role and combined lnd role.
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
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     5
  user: name="{{lnd_user}}"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     6
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     7
- name: unarchive lnd
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:
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    23
    src: "/tmp/{{item.tar_name}}/"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    24
    dest: "/usr/local/bin/{{item.bins}}"
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:
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    30
    - tar_name: "{{lnd_tar_name}}"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    31
      bins:
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    32
        - "lnd"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    33
        - "lncli"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    34
    - tar_name: "{{lndconnect_tar_name}}"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    35
      bins:
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    36
        - "lndconnect"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    37
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    38
- name: create lnd data dir
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    39
  become: yes
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    40
  file:
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    41
    path: "{{item}}"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    42
    state: "directory"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    43
    owner: "{{lnd_user}}"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    44
    group: "{{lnd_user}}"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    45
    mode: "0770"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    46
  with_items:
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    47
    - "{{lnd_data_dir}}"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    48
    - "{{lnd_log_dir}}"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    49
    - "{{lnd_conf_dir}}"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    50
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    51
- name: configure lnd
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    52
  become: yes
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    53
  template:
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    54
    src: "lnd.conf.j2"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    55
    dest: "{{lnd_conf_dir}}/lnd.conf"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    56
    owner: "{{lnd_user}}"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    57
    group: "{{lnd_user}}"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    58
    mode: "0644"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    59
  notify: restart lnd
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    60
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    61
- name: install lnd service
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    62
  become: yes
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    63
  template:
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    64
    src: "lnd.service.j2"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    65
    dest: "/lib/systemd/system/lnd.service"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    66
    mode: "0644"
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    67
  notify: restart lnd
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    68
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    69
- name: ensure lnd is started
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    70
  become: yes
5873b7e583d7 Removed btcd role and combined lnd role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    71
  systemd: service="lnd.service" enabled="yes" state="started" daemon_reload="yes"