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

If registration is needed check that reg_code is provided #298

Merged
merged 1 commit into from
Nov 29, 2024
Merged
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
13 changes: 13 additions & 0 deletions ansible/playbooks/registration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,26 @@
changed_when: false

# Execute Section
- name: Validate reg code
ansible.builtin.assert:
that:
- reg_code | length > 0
fail_msg: "'reg_code' must not be empty"
success_msg: "'reg_code' is OK"
changed_when: false
when:
- not_registered_found
- is_registercloudguest_bin.rc == 0
- not use_suseconnect | bool

# Start by pre-cleaning all. Only run it if:
# - the registercloudguest binary is available
# - there's at least one 'Not Registered' module
# - the user does not require only use SUSEConnect with 'use_suseconnect'
- name: Pre-run cleaning registercloudguest
ansible.builtin.command: registercloudguest --clean
register: cleanout
changed_when: cleanout.rc == 0
when:
- not_registered_found
- is_registercloudguest_bin.rc == 0
Expand Down