Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve Molecule idempotence errors in site.yaml #159

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions roles/maas_rack_controller/tasks/upgrade_maas.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
- name: Update MAAS - Snap
ansible.builtin.command: snap refresh --channel={{ maas_version }}/{{ maas_snap_channel }} maas
register: maas_snap_refresh
when: maas_installation_type | lower == 'snap'
changed_when: "'no updates available' not in maas_snap_refresh.stderr"

- name: Add MAAS apt Repository
ansible.builtin.apt_repository:
Expand Down
6 changes: 6 additions & 0 deletions roles/maas_region_controller/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,18 @@
register: maas_admin_api_key
changed_when: false

- name: "Check MAAS login status"
ansible.builtin.command: maas list
register: maas_login_status
changed_when: false

- name: "Login in MAAS"
ansible.builtin.command: maas login {{ admin_username }} {{ maas_url }} {{ maas_admin_api_key.stdout }}
environment:
http_proxy: ""
https_proxy: ""
no_proxy: "localhost,hostvars[inventory_hostname]['ansible_env'].SSH_CONNECTION.split(' ')[2]"
when: (admin_username + " " + maas_url) not in maas_login_status.stdout
changed_when: true
register: login
until: login is not failed
Expand Down
2 changes: 2 additions & 0 deletions roles/maas_region_controller/tasks/update_maas.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
- name: Update MAAS - Snap
ansible.builtin.command: snap refresh --channel={{ maas_version }}/{{ maas_snap_channel }} maas
register: maas_snap_refresh
when: maas_installation_type | lower == 'snap'
changed_when: "'no updates available' not in maas_snap_refresh.stderr"

- name: Add MAAS apt Repository
ansible.builtin.apt_repository:
Expand Down
Loading