-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2018 from dellhpc/devel-1.4.2.1
merge devel-1.4.2.1 to main
- Loading branch information
Showing
87 changed files
with
2,218 additions
and
1,239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ on: | |
- release-1.4.1 | ||
- release-1.4.2 | ||
- devel-1.4.2 | ||
- devel-1.4.2.1 | ||
- devel-1.5 | ||
|
||
jobs: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
airgap/roles/airgap_validation/tasks/include_provision_config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Copyright 2023 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
--- | ||
|
||
- name: Fetch ansible-vault path | ||
ansible.builtin.command: whereis ansible-vault | ||
changed_when: false | ||
register: ansible_vault_path | ||
tags: init | ||
|
||
- name: Check provision_config.yml file is encrypted | ||
ansible.builtin.command: cat {{ provision_config_filename }} | ||
changed_when: false | ||
register: provision_config_content | ||
no_log: true | ||
tags: init | ||
|
||
- name: Decrpyt provision_config.yml | ||
ansible.builtin.command: >- | ||
{{ ansible_vault_path.stdout.split(' ')[1] }} decrypt {{ provision_config_filename }} | ||
--vault-password-file {{ provision_vault_path }} | ||
changed_when: false | ||
when: ansible_vault_search_key in provision_config_content.stdout | ||
tags: init | ||
|
||
- name: Include provision_config.yml | ||
block: | ||
- name: Include provision_config.yml | ||
ansible.builtin.include_vars: "{{ provision_config_filename }}" | ||
register: include_provision_config | ||
no_log: true | ||
tags: init | ||
rescue: | ||
- name: Failed to include_provision_config.yml | ||
ansible.builtin.fail: | ||
msg: "{{ provision_config_syntax_fail_msg }} Error: {{ include_provision_config.message }}" | ||
|
||
- name: Create ansible vault key | ||
ansible.builtin.set_fact: | ||
provision_vault_key: "{{ lookup('password', '/dev/null chars=ascii_letters') }}" | ||
when: ansible_vault_search_key not in provision_config_content.stdout | ||
tags: init | ||
|
||
- name: Save vault key to provision_vault_path | ||
ansible.builtin.lineinfile: | ||
path: "{{ provision_vault_path }}" | ||
line: "{{ provision_vault_key }}" | ||
mode: "{{ conf_file_mode }}" | ||
owner: root | ||
create: true | ||
when: ansible_vault_search_key not in provision_config_content.stdout | ||
tags: init | ||
|
||
- name: Encrypt provision_config.yml | ||
ansible.builtin.command: >- | ||
{{ ansible_vault_path.stdout.split(' ')[1] }} encrypt {{ provision_config_filename }} | ||
--vault-password-file {{ provision_vault_path }} | ||
changed_when: false | ||
tags: init | ||
|
||
- name: Update provision_config.yml permission | ||
ansible.builtin.file: | ||
path: "{{ provision_config_filename }}" | ||
mode: "{{ conf_file_mode }}" | ||
tags: init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
airgap/roles/airgap_validation/tasks/set_reposync_status.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Copyright 2023 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
--- | ||
|
||
- name: Initialize reposync_status and set update_repos to lowercase | ||
ansible.builtin.set_fact: | ||
reposync_status: false | ||
update_repos: "{{ update_repos | lower }}" | ||
|
||
- name: Verify the value of update_repos | ||
ansible.builtin.assert: | ||
that: | ||
- update_repos == true or update_repos == false | ||
success_msg: "{{ update_repos_success_msg }}" | ||
fail_msg: "{{ update_repos_fail_msg }}" | ||
|
||
- name: Check for CRB repo directory | ||
ansible.builtin.stat: | ||
path: "{{ crb_dir }}" | ||
register: crb_dir_status | ||
|
||
- name: Set reposync_status to true | ||
ansible.builtin.set_fact: | ||
reposync_status: true | ||
when: | ||
- not crb_dir_status.stat.exists or | ||
update_repos | ||
|
||
- name: Reposync will be executed for the repos | ||
ansible.builtin.pause: | ||
seconds: "{{ warning_wait_time }}" | ||
prompt: "{{ reposync_execution_msg }}" | ||
when: reposync_status | ||
|
||
- name: Reposync will be skipped for the repos | ||
ansible.builtin.pause: | ||
seconds: "{{ warning_wait_time }}" | ||
prompt: "{{ reposync_skip_msg }}" | ||
when: not reposync_status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
airgap/roles/airgap_validation/tasks/validate_repo_path.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# Copyright 2023 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
--- | ||
|
||
- name: Set control_plane_os and rhel_repo_alphabetical_folders to lowercase | ||
ansible.builtin.set_fact: | ||
control_plane_os: "{{ ansible_distribution | lower }}" | ||
rhel_repo_alphabetical_folders: "{{ rhel_repo_alphabetical_folders | lower }}" | ||
|
||
- name: Verify the value of rhel_repo_alphabetical_folders | ||
ansible.builtin.assert: | ||
that: | ||
- rhel_repo_alphabetical_folders == true or rhel_repo_alphabetical_folders == false | ||
success_msg: "{{ rhel_repo_folders_success_msg }}" | ||
fail_msg: "{{ rhel_repo_folders_fail_msg }}" | ||
|
||
- name: Initialize rhel_repo_path_status | ||
ansible.builtin.set_fact: | ||
rhel_repo_path_status: false | ||
|
||
- name: Validate rhel_repo_local_path when provision os is rhel | ||
when: provision_os | lower == provision_os_rhel | ||
block: | ||
- name: Fetch redhat subscription status | ||
ansible.builtin.command: subscription-manager list | ||
changed_when: false | ||
register: rhsm_status | ||
when: control_plane_os_redhat in control_plane_os | ||
|
||
- name: Set rhel_repo_path_status to true | ||
ansible.builtin.set_fact: | ||
rhel_repo_path_status: true | ||
when: | ||
- rhel_repo_local_path[0].repo | default("", true) | length > 1 | ||
- rhel_repo_local_path[1].repo | default("", true) | length > 1 | ||
- rhel_repo_local_path[2].repo | default("", true) | length > 1 | ||
- rhel_repo_local_path[0].repo_url | default("", true) | length > 1 | ||
- rhel_repo_local_path[1].repo_url | default("", true) | length > 1 | ||
- rhel_repo_local_path[2].repo_url | default("", true) | length > 1 | ||
- rhel_repo_local_path[0].repo_name | default("", true) | length > 1 | ||
- rhel_repo_local_path[1].repo_name | default("", true) | length > 1 | ||
- rhel_repo_local_path[2].repo_name | default("", true) | length > 1 | ||
|
||
- name: Validate rhel_repo_local_path | ||
when: rhel_repo_path_status | ||
block: | ||
- name: Validate rhel_repo_local_path | ||
ansible.builtin.assert: | ||
that: rhel_repo_local_path | length == 3 | ||
success_msg: "{{ repo_path_count_success_msg }}" | ||
fail_msg: "{{ repo_path_count_fail_msg }}" | ||
|
||
- name: Validate repo, repo_url and repo_name is not empty | ||
ansible.builtin.assert: | ||
that: | ||
- item.repo | default("", true) | length > 1 | ||
- item.repo == rhel_repo_search_key[0] or item.repo == rhel_repo_search_key[1] or item.repo == rhel_repo_search_key[2] | ||
- item.repo_url | default("", true) | length > 1 | ||
- item.repo_name | default("", true) | length > 1 | ||
- '".repo" in item.repo_url' | ||
success_msg: "{{ repo_path_success_msg }}" | ||
fail_msg: "{{ repo_path_fail_msg }}" | ||
with_items: "{{ rhel_repo_local_path }}" | ||
|
||
- name: Warning - redhat subscription not enabled | ||
ansible.builtin.pause: | ||
seconds: "{{ warning_wait_time }}" | ||
prompt: "{{ rhel_subscription_warning_msg }}" | ||
when: | ||
- control_plane_os_redhat in control_plane_os | ||
- subscription_check_key not in rhsm_status.stdout | ||
|
||
- name: Check subscription repos configured | ||
when: | ||
- control_plane_os_redhat in control_plane_os | ||
- not rhel_repo_path_status | ||
block: | ||
- name: Subscription is not enabled | ||
ansible.builtin.fail: | ||
msg: "{{ rhel_subscription_fail_msg }}" | ||
when: subscription_check_key not in rhsm_status.stdout | ||
|
||
- name: Fetch redhat enabled repo list | ||
ansible.builtin.command: subscription-manager repos --list-enabled | ||
changed_when: false | ||
register: rhsm_repo_list | ||
|
||
- name: Check redhat enabled repos | ||
ansible.builtin.assert: | ||
that: | ||
- rhel_repo_search_key[0] | lower in rhsm_repo_list.stdout | lower | ||
- rhel_repo_search_key[1] | lower in rhsm_repo_list.stdout | lower | ||
success_msg: "{{ subscription_repo_success_msg }}" | ||
fail_msg: "{{ subscription_repo_fail_msg }}" |
Oops, something went wrong.