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

Add support for passing environment variables to convert2rhel during convert. #52

Merged
merged 4 commits into from
May 3, 2024
Merged
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
4 changes: 4 additions & 0 deletions changelogs/fragments/allow_env_vars_for_convert.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
minor_changes:
- Add convert_convert2rhel_env_vars variable to pass environment variables to convert2rhel during convert.
...
1 change: 1 addition & 0 deletions roles/convert/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Role Variables
| Name | Type | Default value | Description |
|-----------------------|------|-------------------------|-------------------------------------------------|
| convert_convert2rhel_opts | String | | Optional string to define command line options to be passed to the `convert2rhel` command when running the conversion. |
| convert_convert2rhel_env_vars | Dict | {} | Optional dictionary to define shell environment variables for the `convert2rhel` command when running the conversion. See defaults/main.yml for an example. |
| convert_convert2rhel_eus | Boolean | false | If you are converting to RHEL 8.8 and have an Extended Upgrade Support (EUS), add the --eus option by setting this variable to true. |
| convert_convert2rhel_repos_enabled | List | [] | List of repositories to enable on the target node |
| convert_convert2rhel_repos_disabled | List | [] | List of repositories to disable on the target node |
Expand Down
5 changes: 5 additions & 0 deletions roles/convert/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# defaults file for convert

convert_convert2rhel_opts: ""
convert_convert2rhel_env_vars: {}
# convert_convert2rhel_env_vars:
# CONVERT2RHEL_ALLOW_UNAVAILABLE_KMODS: 1
# CONVERT2RHEL_SKIP_KERNEL_CURRENCY_CHECK: 1

# If you are converting to RHEL 8.8 and have an Extended Upgrade Support (EUS), add the --eus option by setting this variable to true.
convert_convert2rhel_eus: false
convert_convert2rhel_repos_enabled: []
Expand Down
1 change: 1 addition & 0 deletions roles/convert/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
register: convert2rhel
args:
executable: /bin/bash
environment: "{{ convert_convert2rhel_env_vars }}"
async: "{{ convert_async_timeout_maximum | int }}"
poll: "{{ convert_async_poll_interval | int }}"
changed_when: convert2rhel.rc != 0
Expand Down