From 17771486c0ca571ef4a5b17cf3f2b86e74eae40e Mon Sep 17 00:00:00 2001 From: Stamatis Katsaounis Date: Tue, 4 Jun 2024 13:44:18 +0300 Subject: [PATCH] feat: extend prepare-node-script to include Juju wiring --- .github/workflows/build-snap.yml | 4 ---- anvil-python/anvil/commands/prepare_node.py | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-snap.yml b/.github/workflows/build-snap.yml index 9e2e984..9718a18 100644 --- a/.github/workflows/build-snap.yml +++ b/.github/workflows/build-snap.yml @@ -66,8 +66,6 @@ jobs: export COLUMNS=256 sudo snap install ${{ needs.build-amd64.outputs.snap }} --dangerous maas-anvil prepare-node-script | bash -x - sudo snap connect maas-anvil:juju-bin juju:juju-bin - sudo snap connect maas-anvil:dot-local-share-juju sg snap_daemon "maas-anvil -v cluster bootstrap --role database --role region --role agent --role haproxy --accept-defaults" - name: Collect juju status if: always() @@ -96,8 +94,6 @@ jobs: # export COLUMNS=256 # sudo snap install ${{ needs.build-arm64.outputs.snap }} --dangerous # maas-anvil prepare-node-script | bash -x - # sudo snap connect maas-anvil:juju-bin juju:juju-bin - # sudo snap connect maas-anvil:dot-local-share-juju # sg snap_daemon "maas-anvil -v cluster bootstrap --role database --role region --role agent --role haproxy --accept-defaults" # - name: Collect juju status # if: always() diff --git a/anvil-python/anvil/commands/prepare_node.py b/anvil-python/anvil/commands/prepare_node.py index 8ba0d89..2323e38 100644 --- a/anvil-python/anvil/commands/prepare_node.py +++ b/anvil-python/anvil/commands/prepare_node.py @@ -73,6 +73,12 @@ # Workaround a bug between snapd and juju mkdir -p $HOME/.local/share mkdir -p $HOME/.config/anvil + +# Connect snap to the Juju snap interface and provide access to Juju directory. +# These actions will allow anvil bootstrap Juju controller and manage the +# Juju model. +sudo snap connect maas-anvil:juju-bin juju:juju-bin +sudo snap connect maas-anvil:dot-local-share-juju """