Skip to content

Commit 537b7cb

Browse files
committed
Bug fixes
1 parent 104000b commit 537b7cb

4 files changed

Lines changed: 24 additions & 13 deletions

File tree

alts/shared/models.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff 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

alts/worker/runners/base.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff 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([

resources/roles/install_uninstall/defaults/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,8 @@ el7_disablerepo_pkg_prefixes:
44
el7_disablerepo_repos:
55
- centos-7-os
66
- centos-7-updates
7+
dnf_download_utils_pkg: "dnf-utils"
8+
yum_download_utils_pkg: "yum-utils"
9+
force_install_pkgs:
10+
- "systemd-standalone-sysusers"
11+
- "systemd-standalone-tmpfiles"

resources/roles/install_uninstall/tasks/main.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
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') }}"
2121
dnf_args: "{{ default_dnf_args | combine(extra_dnf_args) | combine(disablerepo_args) }}"
22+
force_install: "{{ force_install_pkgs | select('in', pkg_name) | list | length > 0 }}"
2223
apt_args:
2324
allow_unauthenticated: true
2425
vars:
@@ -123,14 +124,24 @@
123124
args: "{{ dnf_args }}"
124125
when:
125126
- ansible_facts.os_family == 'RedHat'
126-
- not (force_install | default(false) | bool)
127+
- not (force_install | bool)
128+
tags:
129+
- install_package
130+
131+
- name: Ensure download utilities are installed
132+
ansible.builtin.package:
133+
name: "{{ yum_download_utils_pkg if ansible_facts.distribution_major_version | int <= 7 else dnf_download_utils_pkg }}"
134+
state: present
135+
when:
136+
- ansible_facts.os_family == 'RedHat'
137+
- force_install | bool
127138
tags:
128139
- install_package
129140

130141
- name: Force install RPM package (bypass conflicts)
131142
when:
132143
- ansible_facts.os_family == 'RedHat'
133-
- force_install | default(false) | bool
144+
- force_install | bool
134145
tags:
135146
- install_package
136147
block:
@@ -141,7 +152,11 @@
141152

142153
- name: Download RPM package
143154
ansible.builtin.shell:
144-
cmd: "dnf download --destdir=/tmp/force_install {{ pkg_name }}"
155+
cmd: >-
156+
{{ 'yumdownloader --destdir=/tmp/force_install'
157+
if ansible_facts.distribution_major_version | int <= 7
158+
else 'dnf download --destdir=/tmp/force_install' }}
159+
{{ pkg_name }}
145160
146161
- name: Install downloaded RPM bypassing conflicts
147162
ansible.builtin.shell:

0 commit comments

Comments
 (0)