pull/206/merge
Daniel 3 years ago committed by GitHub
commit 83e8a05470
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      defaults/main.yml
  2. 12
      tasks/setup-RedHat.yml
  3. 6
      templates/nginx.repo.j2

@ -4,6 +4,7 @@ nginx_default_release: ""
# Used only for Redhat installation, enables source Nginx repo.
nginx_yum_repo_enabled: true
nginx_yum_repo_mainline: false
# Use the official Nginx PPA for Ubuntu, and the version to use if so.
nginx_ppa_use: false

@ -7,8 +7,18 @@
group: "{{ root_group }}"
mode: 0644
when: nginx_yum_repo_enabled | bool
register: repo
- name: Clean the nginx repo
command: >
yum clean all --disablerepo="*" --enablerepo=nginx
args:
warn: false
when: repo.changed
tags: ['skip_ansible_lint']
- name: Ensure nginx is installed.
package:
name: "{{ nginx_package_name }}"
state: present
state: "{{ 'latest' if repo.changed else 'present' }}"
notify: restart nginx

@ -1,5 +1,7 @@
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/{{ ansible_distribution_major_version }}/$basearch/
gpgcheck=0
baseurl=http://nginx.org/packages{{ '/mainline' if nginx_yum_repo_mainline }}/centos/{{ ansible_distribution_major_version }}/$basearch/
enabled=1
gpgcheck=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true