One file repo

pull/26/head
Werner Buck 9 years ago
parent d2ba64a916
commit 647e6fbc03
  1. 14
      tasks/setup-RedHat.yml
  2. 13
      templates/nginx.centos.repo.j2
  3. 10
      templates/nginx.repo.j2
  4. 13
      templates/nginx.rhel.repo.j2

@ -14,23 +14,13 @@
rpm_key: state=present key="{{ nginx_el_repo_gpg_key | upper }}"
when: gpg_key_download.changed
- name: (RedHat) Enable nginx repo.
- name: Enable nginx repo.
template:
src: nginx.rhel.repo.j2
src: nginx.repo.j2
dest: /etc/yum.repos.d/nginx.repo
owner: root
group: root
mode: 0644
when: ansible_distribution == 'RedHat'
- name: (Centos) Enable nginx repo.
template:
src: nginx.centos.repo.j2
dest: /etc/yum.repos.d/nginx.repo
owner: root
group: root
mode: 0644
when: ansible_distribution == 'CentOS'
- name: Ensure nginx is installed.
yum: pkg=nginx state=installed enablerepo=nginx

@ -1,13 +0,0 @@
{% if nginx_el_install_mainline %}
[nginx]
name=nginx repo mainline
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
{% else %}
[nginx]
name=nginx repo stable
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
{% endif %}

@ -0,0 +1,10 @@
[nginx]
{% if nginx_el_install_mainline %}
name=nginx repo mainline
baseurl=http://nginx.org/packages/mainline/{% if ansible_distribution == 'CentOS' %}centos{% else %}rhel{% endif%}/$releasever/$basearch/
{% else %}
name=nginx repo stable
baseurl=http://nginx.org/packages/{% if ansible_distribution == 'CentOS' %}centos{% else %}rhel{% endif%}/$releasever/$basearch/
{% endif %}
gpgcheck=1
enabled=1

@ -1,13 +0,0 @@
{% if nginx_el_install_mainline %}
[nginx]
name=nginx repo mainline
baseurl=http://nginx.org/packages/mainline/rhel/$releasever/$basearch/
gpgcheck=1
enabled=1
{% else %}
[nginx]
name=nginx repo stable
baseurl=http://nginx.org/packages/rhel/$releasever/$basearch/
gpgcheck=1
enabled=1
{% endif %}