Revisit conflicting package removal
In https://review.openstack.org/534819 we introduced the removal of conflicting packages from the targeted host, but then we deleted the list for RedHat in https://review.openstack.org/578844 because yum kept removing and re-adding the same packages. In https://review.openstack.org/603205 we solve the issue properly given that yum is case-insensitive, and the root cause of the repeat remove/install. As such, in this patch, we restore the removal of conflicting packages for RedHat in a different way. Each of the package removal tasks are moved into the tasks specific to each package manager so that each can be handled differently. Change-Id: I70fbfa6eff8796713c6bec32319382273f8281f8 Related-Bug: #1762421 Related-Bug: #1742206
This commit is contained in:
parent
8ec910c4c2
commit
72f402d3e9
|
@ -33,11 +33,6 @@
|
||||||
when:
|
when:
|
||||||
- ansible_architecture == 'ppc64le'
|
- ansible_architecture == 'ppc64le'
|
||||||
|
|
||||||
- name: Remove conflicting distro packages
|
|
||||||
package:
|
|
||||||
name: "{{ galera_server_mariadb_distro_packages_remove | default([]) }}"
|
|
||||||
state: absent
|
|
||||||
|
|
||||||
- include_tasks: "galera_install_{{ ansible_pkg_mgr }}.yml"
|
- include_tasks: "galera_install_{{ ansible_pkg_mgr }}.yml"
|
||||||
|
|
||||||
- name: Record galera has been deployed
|
- name: Record galera has been deployed
|
||||||
|
|
|
@ -13,6 +13,11 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
- name: Remove conflicting distro packages
|
||||||
|
package:
|
||||||
|
name: "{{ galera_server_mariadb_distro_packages_remove | default([]) }}"
|
||||||
|
state: absent
|
||||||
|
|
||||||
- name: If a keyfile is provided, copy the gpg keyfile to the key location
|
- name: If a keyfile is provided, copy the gpg keyfile to the key location
|
||||||
copy:
|
copy:
|
||||||
src: "{{ item.keyfile }}"
|
src: "{{ item.keyfile }}"
|
||||||
|
|
|
@ -13,6 +13,29 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
# Unfortunately yum is case-insensitive, and RDO has mariadb-* packages,
|
||||||
|
# while the MariaDB repo has MariaDB-* packages and they conflict.
|
||||||
|
# To work around this we have to query for any installed RDO/CentOS
|
||||||
|
# packages using rpm, then remove them. We have to remove them without
|
||||||
|
# dependencies, otherwise for distro package installation types on shared
|
||||||
|
# hosts it removes far too many packages.
|
||||||
|
- name: Remove conflicting packages
|
||||||
|
shell: |
|
||||||
|
exit_code=0
|
||||||
|
for pkg in {{ galera_server_mariadb_distro_packages_remove | join(' ') }}; do
|
||||||
|
if rpm --query --quiet ${pkg}; then
|
||||||
|
rpm -ev --nodeps ${pkg}
|
||||||
|
exit_code=2
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
exit ${exit_code}
|
||||||
|
register: _remove_existing_mariadb_packages
|
||||||
|
changed_when: _remove_existing_mariadb_packages.rc == 2
|
||||||
|
failed_when: _remove_existing_mariadb_packages.rc not in [0, 2]
|
||||||
|
args:
|
||||||
|
warn: no
|
||||||
|
executable: /bin/bash
|
||||||
|
|
||||||
- name: Update the local file system CRUD
|
- name: Update the local file system CRUD
|
||||||
file:
|
file:
|
||||||
src: "{{ item.src|default(omit) }}"
|
src: "{{ item.src|default(omit) }}"
|
||||||
|
|
|
@ -13,6 +13,11 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
- name: Remove conflicting distro packages
|
||||||
|
package:
|
||||||
|
name: "{{ galera_server_mariadb_distro_packages_remove }}"
|
||||||
|
state: absent
|
||||||
|
|
||||||
- name: Update the local file system CRUD
|
- name: Update the local file system CRUD
|
||||||
file:
|
file:
|
||||||
src: "{{ item.src|default(omit) }}"
|
src: "{{ item.src|default(omit) }}"
|
||||||
|
|
|
@ -54,6 +54,12 @@ galera_server_mariadb_distro_packages:
|
||||||
- rsync
|
- rsync
|
||||||
- socat
|
- socat
|
||||||
|
|
||||||
|
# Conflicting packages with those from the MariaDB repository
|
||||||
|
galera_server_mariadb_distro_packages_remove:
|
||||||
|
- mariadb-common
|
||||||
|
- mariadb-config
|
||||||
|
- mariadb-server
|
||||||
|
|
||||||
# The packages to uninstall during an upgrade from a previous version
|
# The packages to uninstall during an upgrade from a previous version
|
||||||
galera_server_upgrade_packages_remove:
|
galera_server_upgrade_packages_remove:
|
||||||
- MariaDB-Galera-server
|
- MariaDB-Galera-server
|
||||||
|
|
Loading…
Reference in New Issue