From 155fe9454b907553a351e724da3b5ef3ce8dcb48 Mon Sep 17 00:00:00 2001 From: Giulio Fidente Date: Tue, 9 Mar 2021 17:01:49 +0100 Subject: [PATCH] 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 --- .../tripleo-packages-baremetal-puppet.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml b/deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml index 832163b8cb..117ea3524f 100644 --- a/deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml +++ b/deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml @@ -111,9 +111,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: @@ -145,7 +153,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_param: UpgradeLeappCommandOptions} + upgrade_leapp_command_options: {get_attr: [RoleParametersValue, value, 'upgrade_leapp_command_options']} upgrade_leapp_reboot_timeout: {get_param: UpgradeLeappRebootTimeout} upgrade_leapp_post_reboot_delay: {get_param: UpgradeLeappPostRebootDelay} vars: @@ -178,14 +186,14 @@ outputs: state: latest - 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 }}" @@ -243,7 +251,7 @@ outputs: - '' - - "#!/bin/bash\n\n" - "if [[ -f /etc/resolv.conf.save ]] ; then rm /etc/resolv.conf.save; fi\n\n" - - {get_param: UpgradeInitCommand} + - {get_attr: [RoleParametersValue, value, 'upgrade_init_command']} - name: Run UpgradeInitCommonCommand shell: list_join: