Do not uninstall grub2

When we remove gettext-runtime-mini with zypper, packages that depend
on it will also be removed. This includes grub2. This change uses a
direct call to rpm to remove _only_ one package.

Note that grub2 depends on a gettext-runtime. Uninstalling
gettext-runtime-mini breaks grub2 temporarily until we install
gettext-runtime.

Change-Id: I07489015e5e3435bac7080538085a39aba3100b7
This commit is contained in:
Nicolas Bock 2018-09-13 16:36:46 -06:00
parent 0059858148
commit 85c0ecf52e
No known key found for this signature in database
GPG Key ID: 9E90013DEF7F5B7B
2 changed files with 18 additions and 2 deletions

View File

@ -32,6 +32,24 @@
when:
- snapper_root_config.stat.exists
# NOTE(nicolasbock) The gettext-runtime-mini package conflicts with
# gettext-runtime. But removing it with zypper will also remove
# grub2. We call `rpm` directly to remove _only_ gettext-runtime-mini.
- name: Remove gettext-runtime-mini without removing grub2
shell: |
return_code=0
if rpm --query --info gettext-runtime-mini; then
rpm --erase --verbose --nodeps gettext-runtime-mini
return_code=2
fi
exit ${return_code}
args:
executable: /bin/bash
warn: false
register: _remove_gettext_runtime_mini
changed_when: _remove_gettext_runtime_mini.rc == 2
failed_when: _remove_gettext_runtime_mini.rc not in [0, 2]
- name: Remove the blacklisted packages
package:
name: "{{ openstack_hosts_package_list | selectattr('state','equalto','absent') | map(attribute='name') | list }}"

View File

@ -94,8 +94,6 @@ _package_repos_keys: []
_package_list:
- name: systemd-logger
state: absent # conflicts with rsyslog
- name: gettext-runtime-mini
state: absent # conflicts with gettext-runtime
## full example:
#_package_repos: