Removed btcd role and combined lnd role.
authorLuke Hoersten <luke@hoersten.org>
Tue, 12 May 2020 19:47:57 -0500
changeset 5 5873b7e583d7
parent 4 9934a00b9e97
child 6 e0672e50e2c5
Removed btcd role and combined lnd role.
bitcoind/defaults/main.yaml
btcd/defaults/main.yaml
btcd/meta/main.yaml
btcd/templates/btcd.conf.j2
btcd/templates/btcd.service.j2
lnd/defaults/main.yaml
lnd/handlerls/main.yaml
lnd/meta/main.yaml
lnd/tasks/main.yaml
node/conf/defaults/main.yaml
node/conf/handlers/main.yaml
node/conf/tasks/main.yaml
node/install/tasks/main.yaml
--- a/bitcoind/defaults/main.yaml	Tue May 12 19:19:36 2020 -0500
+++ b/bitcoind/defaults/main.yaml	Tue May 12 19:47:57 2020 -0500
@@ -1,6 +1,6 @@
 ---
 
-bitcoind_user: "{{node_user}}"
+bitcoind_user: "bitcoin"
 bitcoind_version: "0.19.1"
 bitcoind_arch: "{{ansible_architecture}}"
 bitcoind_url: "https://bitcoin.org/bin/bitcoin-core-{{bitcoind_version}}/bitcoin-{{bitcoind_version}}-{{bitcoind_arch}}-linux-gnu.tar.gz"
--- a/btcd/defaults/main.yaml	Tue May 12 19:19:36 2020 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
----
-
-btcd_user: "{{node_user}}"
-btcd_version: "v0.20.1-beta"
-btcd_arch: "armv7"
-btcd_tar_name: "btcd-linux-{{btcd_arch}}-{{btcd_version}}"
-btcd_tar: "{{btcd_tar_name}}.tar.gz"
-btcd_url: "https://github.com/btcsuite/btcd/releases/download/{{btcd_version}}/{{btcd_tar}}"
-btcd_enable_txindex: true
--- a/btcd/meta/main.yaml	Tue May 12 19:19:36 2020 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
----
-
-dependencies:
-  - role: node/install
-    vars:
-      node_install_user:     "{{btcd_user}}"
-      node_install_url:      "{{btcd_url}}"
-      node_install_tar:      "{{btcd_tar}}"
-      node_install_tar_name: "{{btcd_tar_name}}"
-
-  - role: node/conf
-    vars:
-      node_type: "btcd"
-      node_conf_template: "btcd.conf.j2"
-      node_service_template: "btcd.service.j2"
-      node_data_dir: "{{btcd_data_dir}}"
-      node_log_dir: "{{btcd_log_dir}}"
--- a/btcd/templates/btcd.conf.j2	Tue May 12 19:19:36 2020 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-[Application Options]
-externalip={{node_external_ip}}
-uacomment={{btcd_comment}}
-
-datadir={{btcd_data_dir}}
-logdir={{btcd_log_dir}}
-debuglevel=error
-
-rpcuser={{btcd_rpc_user}}
-rpcpass={{btcd_rpc_pass}}
-
-txindex={{btcd_enable_txindex}}
-
-{% for peer in btcd_add_peer %}addpeer={{peer}}
-{% endfor %}
--- a/btcd/templates/btcd.service.j2	Tue May 12 19:19:36 2020 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-[Unit]
-Description=btcd
-After=network.target
-
-[Service]
-ExecStart=/usr/local/bin/btcd
-User={{btcd_user}}
-Restart=on-failure
-
-PrivateTmp=true
-ProtectSystem=full
-NoNewPrivileges=true
-PrivateDevices=true
-MemoryDenyWriteExecute=true
-
-[Install]
-WantedBy=multi-user.target
--- a/lnd/defaults/main.yaml	Tue May 12 19:19:36 2020 -0500
+++ b/lnd/defaults/main.yaml	Tue May 12 19:47:57 2020 -0500
@@ -6,9 +6,10 @@
 lnd_tar_name: "lnd-linux-{{lnd_arch}}-{{lnd_version}}"
 lnd_tar: "{{lnd_tar_name}}.tar.gz"
 lnd_url: "https://github.com/lightningnetwork/lnd/releases/download/{{lnd_version}}/{{lnd_tar}}"
+lnd_conf_dir: "/home/{{lnd_user}}/.lnd"
 
 lndconnect_user: "{{node_user}}"
 lndconnect_version: "v0.2.0"
-lndconnect_tar_name: "lndconnect-linux-armv7-{{lndconnect_version}}"
+lndconnect_tar_name: "lndconnect-linux-{{lnd_arch}}-{{lndconnect_version}}"
 lndconnect_tar: "{{lndconnect_tar_name}}.tar.gz"
 lndconnect_url: "https://github.com/LN-Zap/lndconnect/releases/download/{{lndconnect_version}}/{{lndconnect_tar}}"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lnd/handlerls/main.yaml	Tue May 12 19:47:57 2020 -0500
@@ -0,0 +1,5 @@
+---
+
+- name: restart lnd
+  become: yes
+  systemd: service="lnd.service" state="restarted" daemon_reload="yes"
--- a/lnd/meta/main.yaml	Tue May 12 19:19:36 2020 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
----
-
-dependencies:
-  - role: node/install
-    vars:
-      node_install_user:     "{{lnd_user}}"
-      node_install_url:      "{{lnd_url}}"
-      node_install_tar:      "{{lnd_tar}}"
-      node_install_tar_name: "{{lnd_tar_name}}"
-
-  - role: node/install
-    vars:
-      node_install_user:     "{{lndconnect_user}}"
-      node_install_url:      "{{lndconnect_url}}"
-      node_install_tar:      "{{lndconnect_tar}}"
-      node_install_tar_name: "{{lndconnect_tar_name}}"
-
-  - role: node/conf
-    vars:
-      node_type: "lnd"
-      node_conf_template: "lnd.conf.j2"
-      node_service_template: "lnd.service.j2"
-      node_data_dir: "{{lnd_data_dir}}"
-      node_log_dir: "{{lnd_log_dir}}"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lnd/tasks/main.yaml	Tue May 12 19:47:57 2020 -0500
@@ -0,0 +1,71 @@
+---
+
+- name: add lnd user
+  become: yes
+  user: name="{{lnd_user}}"
+
+- name: unarchive lnd
+  become: yes
+  unarchive:
+    remote_src: yes
+    src: "{{item.url}}"
+    dest: "/tmp"
+    creates: "/tmp/{{item.tar_name}}/"
+  loop:
+    - url: "{{lnd_url}}"
+      tar_name: "{{lnd_tar_name}}"
+    - url: "{{lndconnect_url}}"
+      tar_name: "{{lndconnect_tar_name}}"
+
+- name: install lnd
+  become: yes
+  copy:
+    src: "/tmp/{{item.tar_name}}/"
+    dest: "/usr/local/bin/{{item.bins}}"
+    remote_src: yes
+    owner: "root"
+    group: "root"
+    mode: "0755"
+  loop:
+    - tar_name: "{{lnd_tar_name}}"
+      bins:
+        - "lnd"
+        - "lncli"
+    - tar_name: "{{lndconnect_tar_name}}"
+      bins:
+        - "lndconnect"
+
+- name: create lnd data dir
+  become: yes
+  file:
+    path: "{{item}}"
+    state: "directory"
+    owner: "{{lnd_user}}"
+    group: "{{lnd_user}}"
+    mode: "0770"
+  with_items:
+    - "{{lnd_data_dir}}"
+    - "{{lnd_log_dir}}"
+    - "{{lnd_conf_dir}}"
+
+- name: configure lnd
+  become: yes
+  template:
+    src: "lnd.conf.j2"
+    dest: "{{lnd_conf_dir}}/lnd.conf"
+    owner: "{{lnd_user}}"
+    group: "{{lnd_user}}"
+    mode: "0644"
+  notify: restart lnd
+
+- name: install lnd service
+  become: yes
+  template:
+    src: "lnd.service.j2"
+    dest: "/lib/systemd/system/lnd.service"
+    mode: "0644"
+  notify: restart lnd
+
+- name: ensure lnd is started
+  become: yes
+  systemd: service="lnd.service" enabled="yes" state="started" daemon_reload="yes"
--- a/node/conf/defaults/main.yaml	Tue May 12 19:19:36 2020 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
----
-
-node_conf_dir: "/home/{{node_user}}/.{{node_type}}"
--- a/node/conf/handlers/main.yaml	Tue May 12 19:19:36 2020 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
----
-
-- name: restart node
-  become: yes
-  systemd: service="{{node_type}}.service" state="restarted" daemon_reload="yes"
--- a/node/conf/tasks/main.yaml	Tue May 12 19:19:36 2020 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
----
-
-- name: create node data dir
-  become: yes
-  file:
-    path: "{{item}}"
-    state: "directory"
-    owner: "{{node_user}}"
-    group: "{{node_user}}"
-    mode: "0770"
-  with_items:
-    - "{{node_data_dir}}"
-    - "{{node_log_dir}}"
-    - "{{node_conf_dir}}"
-
-- name: configure node
-  become: yes
-  template:
-    src: "{{node_conf_template}}"
-    dest: "{{node_conf_dir}}/{{node_type}}.conf"
-    owner: "{{node_user}}"
-    group: "{{node_user}}"
-    mode: "0644"
-  notify: restart node
-
-- name: install node service
-  become: yes
-  template:
-    src: "{{node_service_template}}"
-    dest: "/lib/systemd/system/{{node_type}}.service"
-    mode: "0644"
-  notify: restart node
-
-- name: ensure node is started
-  become: yes
-  systemd: service="{{node_type}}.service" enabled="yes" state="started" daemon_reload="yes"
--- a/node/install/tasks/main.yaml	Tue May 12 19:19:36 2020 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
----
-
-- name: add node user
-  become: yes
-  user: name="{{node_install_user}}"
-
-- name: unarchive node
-  become: yes
-  unarchive:
-    remote_src: yes
-    src: "{{node_install_url}}"
-    dest: "/tmp"
-    creates: "/tmp/{{node_install_tar_name}}/"
-
-- name: install node
-  become: yes
-  copy:
-    src: "/tmp/{{node_install_tar_name}}/"
-    dest: "/usr/local/bin/"
-    remote_src: yes
-    owner: "root"
-    group: "root"
-    mode: "0755"