File tree Expand file tree Collapse file tree
resources/roles/install_uninstall Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -318,10 +318,6 @@ def __init__(self, **data):
318318 'kernel' ,
319319 'dnf' ,
320320 ]
321- force_install_pkgs : List [str ] = [
322- 'systemd-standalone-sysusers' ,
323- 'systemd-standalone-tmpfiles' ,
324- ]
325321 keepalive_interval : int = 30 # unit in seconds
326322 commands_exec_timeout : int = 30 # unit in seconds
327323 provision_timeout : int = 1200 # 20 minutes in seconds
Original file line number Diff line number Diff line change @@ -876,13 +876,10 @@ def install_package_no_log(
876876 package_version = package_version ,
877877 package_epoch = package_epoch ,
878878 )
879- force_install = package_name in CONFIG .force_install_pkgs
880-
881879 self ._logger .info (
882- 'Installing %s on %s...%s ' ,
880+ 'Installing %s on %s...' ,
883881 full_pkg_name ,
884882 self .env_name ,
885- ' (force install due to known conflicts)' if force_install else '' ,
886883 )
887884 cmd_args = [
888885 '-i' ,
@@ -894,8 +891,6 @@ def install_package_no_log(
894891 f'pkg_version={ package_version } ' ,
895892 '-e' ,
896893 f'dist_name={ dist_name } ' ,
897- '-e' ,
898- f'force_install={ force_install } ' ,
899894 ]
900895 if module_name and module_stream and module_version :
901896 cmd_args .extend ([
Original file line number Diff line number Diff line change 1+ ---
2+ dnf_download_utils_pkg : " dnf-utils"
3+ yum_download_utils_pkg : " yum-utils"
4+ force_install_pkgs :
5+ - " systemd-standalone-sysusers"
6+ - " systemd-standalone-tmpfiles"
Original file line number Diff line number Diff line change 1818 is_ea_apache24_mod_lsapi : " {{ pkg_name.startswith('ea-apache24-mod-lsapi') }}"
1919 is_ea_apache24_mod_cgid : " {{ pkg_name.startswith('ea-apache24-mod_cgid') }}"
2020 is_ea_apache24_mod_http2 : " {{ pkg_name.startswith('ea-apache24-mod_http2') }}"
21+ force_install : " {{ force_install_pkgs | select('in', pkg_name) | list | length > 0 }}"
2122 dnf_args : " {{ default_dnf_args | combine(extra_dnf_args) }}"
2223 apt_args :
2324 allow_unauthenticated : true
118119 args : " {{ dnf_args }}"
119120 when :
120121 - ansible_facts.os_family == 'RedHat'
121- - not (force_install | default(false) | bool)
122+ - not (force_install | bool)
123+ tags :
124+ - install_package
125+
126+ - name : Ensure download utilities are installed
127+ ansible.builtin.package :
128+ name : " {{ yum_download_utils_pkg if ansible_facts.distribution_major_version | int <= 7 else dnf_download_utils_pkg }}"
129+ state : present
130+ when :
131+ - ansible_facts.os_family == 'RedHat'
132+ - force_install | bool
122133 tags :
123134 - install_package
124135
125136- name : Force install RPM package (bypass conflicts)
126137 when :
127138 - ansible_facts.os_family == 'RedHat'
128- - force_install | default(false) | bool
139+ - force_install | bool
129140 tags :
130141 - install_package
131142 block :
136147
137148 - name : Download RPM package
138149 ansible.builtin.shell :
139- cmd : " dnf download --destdir=/tmp/force_install {{ pkg_name }}"
150+ cmd : >-
151+ {{ 'yumdownloader --destdir=/tmp/force_install'
152+ if ansible_facts.distribution_major_version | int <= 7
153+ else 'dnf download --destdir=/tmp/force_install' }}
154+ {{ pkg_name }}
140155
141156 - name : Install downloaded RPM bypassing conflicts
142157 ansible.builtin.shell :
You can’t perform that action at this time.
0 commit comments