Browse Source

Tidy yum repository setup

Clear repo metadata after adding both galera and percona repos rather
than only after galera, and pass priority directly to yum_repository
ansible module.

Change-Id: I88c7e16901d2b5dffae31772b655b4a7820cf73a
Jonathan Rosser 3 months ago
parent
commit
26d546fe8b
1 changed files with 18 additions and 30 deletions
  1. 18
    30
      tasks/galera_install_yum.yml

+ 18
- 30
tasks/galera_install_yum.yml View File

@@ -109,24 +109,12 @@
109 109
     gpgkey: "{{ galera_repo.gpgkey | default(omit) }}"
110 110
     gpgcheck: yes
111 111
     enabled: yes
112
-  register: add_repos
113
-  until: add_repos is success
112
+    priority: 25
113
+  register: add_galera_repos
114
+  until: add_galera_repos is success
114 115
   retries: 5
115 116
   delay: 2
116 117
 
117
-# When changing the repo URL, the metadata does
118
-# not reliably update, resulting in the right
119
-# URL being used, but the wrong package list.
120
-# This is why we force the metadata to be
121
-# cleaned out whenever the repo config changes.
122
-- name: Force the expiry of the repo metadata
123
-  command: "{{ ansible_pkg_mgr }} clean metadata"
124
-  args:
125
-    warn: no
126
-  when: add_repos is changed
127
-  tags:
128
-    - skip_ansible_lint
129
-
130 118
 - name: Install percona repo
131 119
   yum_repository:
132 120
     name: 'percona-release-$basearch'
@@ -135,24 +123,24 @@
135 123
     enabled: true
136 124
     gpgcheck: true
137 125
     state: "{{ galera_percona_xtrabackup_repo.state }}"
138
-  register: install_packages
139
-  until: install_packages is success
126
+    priority: 25
127
+  register: add_percona_repos
128
+  until: add_percona_repos is success
140 129
   retries: 5
141 130
   delay: 2
142 131
 
143
-# NOTE(mhayden): MariaDB/percona repositories are prioritized at 99 by default
144
-# and that allows yum to install galera from the RDO repos, which is not good.
145
-# This task ensures that the following task will choose MariaDB/percona repos
146
-# as the highest priority.
147
-- name: Ensure MariaDB/percona repositories take highest priority
148
-  command: |
149
-    yum-config-manager
150
-      --enable {{ item }}
151
-      --setopt="{{ item }}.priority=25"
152
-  with_items:
153
-    - MariaDB
154
-    - percona-release-noarch
155
-    - percona-release-x86_64
132
+# When changing the repo URL, the metadata does
133
+# not reliably update, resulting in the right
134
+# URL being used, but the wrong package list.
135
+# This is why we force the metadata to be
136
+# cleaned out whenever the repo config changes.
137
+- name: Force the expiry of the repo metadata
138
+  command: "{{ ansible_pkg_mgr }} clean metadata"
139
+  args:
140
+    warn: no
141
+  when: (add_galera_repos is changed) or (add_percona_repos is changed)
142
+  tags:
143
+    - skip_ansible_lint
156 144
 
157 145
 - name: Install galera_server role remote packages
158 146
   package:

Loading…
Cancel
Save