Use distro packages for nginx on centos.

There is no longer any need to get these from EPEL or the
nginx repos.

Change-Id: I24a031b5e14359f08a231dfc3429468561d48126
This commit is contained in:
Jonathan Rosser 2022-05-12 17:38:44 +01:00 committed by Dmitriy Rabotyagov
parent 309c235a8a
commit e31bee556c
3 changed files with 21 additions and 14 deletions

View File

@ -23,10 +23,6 @@ repo_nginx_threads: "{{ [[ansible_facts['processor_vcpus']|default(2) // 2, 1] |
## APT Cache Options
cache_timeout: 600
## Centos NGINX repository options
repo_centos_nginx_mirror: "{{ centos_nginx_mirror | default('http://nginx.org/packages/centos/$releasever/$basearch') }}"
repo_centos_nginx_key: "{{ centos_nginx_key | default('http://nginx.org/keys/nginx_signing.key') }}"
# Set the package install state for distribution and pip packages
# Options are 'present' and 'latest'
repo_server_package_state: "latest"

View File

@ -0,0 +1,8 @@
---
upgrade:
- |
The use of the nginx package repository on RedHat derived operating
systems is no longer required as there is a new enough version of the
nginx package in the standard distro repos now. The variables
``repo_centos_nginx_mirror`` and ``repo_centos_nginx_key`` are removed from
the repo_server role and no longer have any effect.

View File

@ -13,18 +13,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Add NGINX repository
- name: Remove old nginx repo
yum_repository:
name: nginx
description: 'nginx repo'
baseurl: "{{ repo_centos_nginx_mirror }}"
gpgkey: "{{ repo_centos_nginx_key }}"
name: "nginx"
state: absent
register: _repo_removed
when:
- ansible_facts['pkg_mgr'] == 'dnf'
register: add_nginx_repo
until: add_nginx_repo is success
retries: 5
delay: 2
- name: Clean yum metadata when nginx repo is removed
command: dnf clean metadata
args:
warn: no
when:
- ansible_facts['pkg_mgr'] == 'dnf'
- _repo_removed is changed
- name: Install distro packages
package:
@ -35,4 +38,4 @@
register: install_packages
until: install_packages is success
retries: 5
delay: 5
delay: 5