diff options
author | Lars Wirzenius <liw@liw.fi> | 2024-02-13 17:32:19 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2024-02-13 17:32:19 +0200 |
commit | b4aceb363ffb824d148bdbaf0f10e98201346b5d (patch) | |
tree | fd75ca7d869dac6d624ef61335ff981a6c4fa5b5 | |
parent | b4451d0eb0db41a15c1d6da223132fe6774e6f65 (diff) | |
download | debian-ansible-b4aceb363ffb824d148bdbaf0f10e98201346b5d.tar.gz |
feat(radicle_node): set alias, external address
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Sponsored-by: author
-rw-r--r-- | roles/radicle_node/tasks/main.yml | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/roles/radicle_node/tasks/main.yml b/roles/radicle_node/tasks/main.yml index 8b07eab..13a20e6 100644 --- a/roles/radicle_node/tasks/main.yml +++ b/roles/radicle_node/tasks/main.yml @@ -126,7 +126,7 @@ WantedBy=multi-user.target dest: /lib/systemd/system/radicle-node.service -- name: "install script to add nodes to connect to the Radicle config file" +- name: "install script to add update Radicle config file" when: radicle_node_connections is defined copy: content: | @@ -134,14 +134,21 @@ import json, os, subprocess, sys + alias = sys.argv[1] + ext = sys.argv[2] + peer = sys.argv[3] + p = subprocess.run(["rad", "config", "show"], check=True, capture_output=True) if p.returncode != 0: sys.exit("rad config show failed") config = json.loads(p.stdout.decode()) + + config["node"]["alias"] = alias + config["node"]["externalAddresses"] = [ext] + nodes = config["node"]["connect"] - for new in sys.argv[1:]: - if new not in nodes: - nodes.append(new) + if peer not in nodes: + nodes.append(peer) p = subprocess.run(["rad", "self", "--home"], check=True, capture_output=True) if p.returncode != 0: @@ -164,7 +171,7 @@ shell: | cat <<'EOF' > /tmp/connect.sh export PATH="$HOME/.radicle/bin:$PATH" - ./radicle-perma-connect "{{ item.nid }}@{{ item.host }}:{{ item.port }}" + ./radicle-perma-connect "{{ radicle_node_domain_name }}" "{{ radicle_node_domain_name }}:8776" "{{ item.nid }}@{{ item.host }}:{{ item.port }}" EOF sudo -u _rad -i bash -ex /tmp/connect.sh |