Browse Source

Make UpgradeInitCommand and UpgradeLeapp{ToRemove,ToInstall,CommandOptions} per-role

When specific roles are deployed with custom images, for example CephStorage with
overcloud-minimal, then the LeappCommandOptions and/or the list of packages to
be removed/installed is not the same across all roles.

This change makes four parameters to be customized on a per-role basis:
UpgradeInitCommand
UpgradeLeappToRemove
UpgradeLeappToInstall
UpgradeLeappCommandOptions

Related-Bug: 1915067
Closes-Bug: rhbz#1936419
Change-Id: Ifd373f7aba6d98baa843b141de8a2266eaa71a0b
(cherry picked from commit 155fe9454b907553a351e724da3b5ef3ce8dcb48)
(cherry picked from commit dbad3a079b7c04066008b6ef9cd38cdaa0b80056)
(cherry picked from commit 284629a8741cdeba3becadffa95afe10fde36c14)
changes/56/781056/1
Giulio Fidente 1 month ago
committed by Jesse Pretorius (odyssey4me)
parent
commit
25493bcb16
1 changed files with 12 additions and 3 deletions
  1. +12
    -3
      deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml

+ 12
- 3
deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml View File

@ -131,9 +131,17 @@ resources:
map_replace:
- map_replace:
- dnf_module_list: DnfStreams
upgrade_leapp_command_options: UpgradeLeappCommandOptions
upgrade_leapp_to_remove: UpgradeLeappToRemove
upgrade_leapp_to_install: UpgradeLeappToInstall
upgrade_init_command: UpgradeInitCommand
- values: {get_param: [RoleParameters]}
- values:
DnfStreams: {get_param: DnfStreams}
UpgradeLeappCommandOptions: {get_param: UpgradeLeappCommandOptions}
UpgradeLeappToRemove: {get_param: UpgradeLeappToRemove}
UpgradeLeappToInstall: {get_param: UpgradeLeappToInstall}
UpgradeInitCommand: {get_param: UpgradeInitCommand}
outputs:
role_data:
@ -162,6 +170,7 @@ outputs:
ansible_facts['distribution_major_version'] is version('7', '==') }}
upgrade_leapp_debug: {get_param: UpgradeLeappDebug}
upgrade_leapp_devel_skip: {get_param: UpgradeLeappDevelSkip}
upgrade_leapp_command_options: {get_attr: [RoleParametersValue, value, 'upgrade_leapp_command_options']}
upgrade_leapp_command_options: {get_param: UpgradeLeappCommandOptions}
upgrade_leapp_reboot_timeout: {get_param: UpgradeLeappRebootTimeout}
upgrade_leapp_post_reboot_delay: {get_param: UpgradeLeappPostRebootDelay}
@ -331,14 +340,14 @@ outputs:
state: absent
- name: "add packages into Leapp's to_remove file"
vars:
pkg_to_remove: { get_param: UpgradeLeappToRemove }
pkg_to_remove: { get_attr: [RoleParametersValue, value, 'upgrade_leapp_to_remove']}
lineinfile:
path: "/etc/leapp/transaction/to_remove"
line: "{{ item }}"
loop: "{{ pkg_to_remove }}"
- name: "add packages into Leapp's to_install file"
vars:
pkg_to_install: { get_param: UpgradeLeappToInstall }
pkg_to_install: {get_attr: [RoleParametersValue, value, 'upgrade_leapp_to_install']}
lineinfile:
path: "/etc/leapp/transaction/to_install"
line: "{{ item }}"
@ -421,7 +430,7 @@ outputs:
list_join:
- ''
- - "#!/bin/bash\n\n"
- {get_param: UpgradeInitCommand}
- {get_attr: [RoleParametersValue, value, 'upgrade_init_command']}
- name: Run UpgradeInitCommonCommand
shell:
list_join:


Loading…
Cancel
Save