sunbeam-charms/roles/k8s-cloud/tasks/main.yaml
Guillaume Boutry 0bda4738e3
[tests] migrate tests to k8s
Migrate tests from microk8s to ck8s.
Bootstrap a controller on a manual cloud, and add ck8s to available
clouds.

Upgrade juju to 3.5

Configure ephemeral device when available, configure k8s to use it for
local storage.

Change-Id: Ief491f8b339307f0c43d11639336b02d9f6479b4
Signed-off-by: Guillaume Boutry <guillaume.boutry@canonical.com>
2024-09-18 12:31:05 +02:00

44 lines
1.2 KiB
YAML

- name: Ensure k8s is bootstrapped
ansible.builtin.include_role:
name: k8s
- name: Juju is installed
communityu.general.snap:
name: juju
classic: "{{ juju_classic_mode | default(false) }}"
channel: "{{ juju_channel | default('latest/stable') }}"
become: true
- name: Ensure ~/.local/share directory exist
ansible.builtin.file:
path: ~/.local/share
state: directory
mode: '0755'
- name: Juju is bootstrapped on k8s
ansible.builtin.command:
cmd: juju bootstrap --config bootstrap-timeout=600 --config caas-image-repo="ghcr.io/juju" k8s k8s
register: res
retries: 3
delay: 10
until: >
"Bootstrap complete" in res.stderr or
"already exists" in res.stderr
changed_when: '"already exists" not in res.stderr'
failed_when: '"ERROR" in res.stderr and "already exists" not in res.stderr'
- name: Current juju controller is k8s
ansible.builtin.command:
cmd: juju switch k8s
register: res
changed_when: '"no change" not in res.stderr'
- name: Collect snap versions
ansible.builtin.command: snap list
register: snap_out
changed_when: false
- name: Show snap versions
ansible.builtin.debug:
msg: "{{ snap_out.stdout }}"