From 4aa6390bb52e6a3f5f982b50ed035dbd2afb8be9 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 7 Feb 2024 12:34:29 +0200 Subject: radicle-other-node: connect to other nodes Signed-off-by: Lars Wirzenius Sponsored-by: author --- ansible/radicle-other-node.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/ansible/radicle-other-node.yml b/ansible/radicle-other-node.yml index 5f24b25..00abce7 100644 --- a/ansible/radicle-other-node.yml +++ b/ansible/radicle-other-node.yml @@ -67,13 +67,31 @@ WantedBy=default.target dest: /lib/systemd/system/radicle-node.service - - name: "enable systemd unit for Radicle node" + - name: "start systemd unit for Radicle node" systemd: name: radicle-node state: restarted masked: no enabled: yes daemon_reload: yes + + # Ansible does not seem to always actually start the unit, so do + # it manually. This seems to only happen on the first run on a + # freshly created host. + - name: "actually start node" + shell: | + systemctl restart radicle-node + systemctl status radicle-node + + - name: "connect to other Radicle nodes" + with_items: "{{ radicle_connections }}" + shell: | + cat <<'EOF' > connect.sh + export PATH="$HOME/.radicle/bin:$PATH" + rad node status + rad node connect "{{ item.nid }}@{{ item.host }}:{{ item.port }}" + EOF + sudo -u _rad bash -ex connect.sh vars: sane_debian_system_version: 2 sane_debian_system_hostname: "{{ inventory_hostname }}" @@ -92,3 +110,7 @@ radicle_key: "{{ lookup('pipe', 'pass radicle/radicle-other-node/key') }}" radicle_pub: "{{ lookup('pipe', 'pass radicle/radicle-other-node/key.pub') }}" + radicle_connections: + - nid: z6MkfXa53s1ZSFy8rktvyXt5ADCojnxvjAoQpzajaXyLqG5n + host: radicle.liw.fi + port: 8776 -- cgit v1.2.1