diff --git a/action.yaml b/action.yaml index d5e720c..f862e40 100644 --- a/action.yaml +++ b/action.yaml @@ -74,8 +74,25 @@ runs: shell: bash run: | sudo iptables -I DOCKER-USER -j ACCEPT - sudo snap install lxd - sudo snap refresh lxd + if snap list lxd 2> /dev/null; then + for i in {1..10}; do + if [ $i == 10 ]; then + sudo snap refresh lxd --channel 5.21/stable + else + sudo snap refresh lxd --channel 5.21/stable && break || : + fi + sleep 5 + done + else + for i in {1..10}; do + if [ $i == 10 ]; then + sudo snap install lxd --channel 5.21/stable + else + sudo snap install lxd --channel 5.21/stable && break || : + fi + sleep 5 + done + fi sudo lxd waitready sudo lxd init --auto sudo lxc project create devstack -c features.images=false