diff options
author | Lars Wirzenius <liw@liw.fi> | 2024-02-07 12:34:29 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2024-02-07 12:34:29 +0200 |
commit | 4aa6390bb52e6a3f5f982b50ed035dbd2afb8be9 (patch) | |
tree | 400b219fe87b6810cdc8b5128607146ceca3c239 | |
parent | 89ddbdb9c72d02af78e167669d576f0a5742cbd3 (diff) | |
download | ansibleness-4aa6390bb52e6a3f5f982b50ed035dbd2afb8be9.tar.gz |
radicle-other-node: connect to other nodes
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Sponsored-by: author
-rw-r--r-- | ansible/radicle-other-node.yml | 24 |
1 files changed, 23 insertions, 1 deletions
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 |