ansible-role-nginx/tasks/opensource/setup-redhat.yml

25 lines
825 B
YAML
Raw Normal View History

2018-01-10 23:40:01 +01:00
---
- name: "(Install: CentOS/RedHat) Set Default YUM NGINX Repository"
set_fact:
default_repository: >-
https://nginx.org/packages/{{ (nginx_branch == 'mainline')
| ternary('mainline/', '') }}{{ (ansible_distribution == "RedHat")
| ternary('rhel', 'centos') }}/{{ ansible_distribution_major_version }}/$basearch/
- name: "(Install: CentOS/RedHat) Set YUM NGINX Repository"
set_fact:
repository: "{{ nginx_repository | default(default_repository) }}"
2018-05-12 00:12:06 +02:00
- name: "(Install: CentOS/RedHat) Add NGINX Repository"
2018-01-10 23:40:01 +01:00
yum_repository:
name: nginx
baseurl: "{{ repository }}"
2018-01-10 23:40:01 +01:00
description: NGINX Repository
enabled: yes
gpgcheck: yes
- name: "(Install: CentOS/RedHat) Install NGINX"
yum:
name: "nginx{{ nginx_version | default('') }}"
notify: "(Handler: All OSs) Start NGINX"