From 16b1561ee287e13139a6e00112991d1dda409c16 Mon Sep 17 00:00:00 2001 From: Felipe Reyes Date: Wed, 7 Feb 2024 10:27:51 -0300 Subject: [PATCH] Install the juju snap as classic only when the channel is 2.9 Juju's '2.9' snap track publishes a snap with the classic confinement, while juju>=3.1 uses a strict confinement, instead of asking users to understand this, we encapsulate this information into the ansible task. --- playbooks/juju/pre.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/playbooks/juju/pre.yaml b/playbooks/juju/pre.yaml index b05b74f..b45d00c 100644 --- a/playbooks/juju/pre.yaml +++ b/playbooks/juju/pre.yaml @@ -19,7 +19,12 @@ become: true snap: name: juju - classic: yes + # NOTE(freyes): Juju's '2.9' snap track publishes a snap with the + # classic confinement, while juju>=3.1 uses a strict confinement, + # instead of asking users to understand this, we encapsulate this + # information into this inline-if where if the juju_snap_channel has the + # '2.9/' prefix the classic field is set to True, otherwise False. + classic: "{{ True if juju_snap_channel and juju_snap_channel.startswith('2.9/') else False }}" channel: "{{ juju_snap_channel }}" register: result until: result is not failed