ansible-role-nginx/tasks/opensource/setup-redhat.yml
Alessandro Fael Garcia f6c48c12d6
Add Alpine tests to all molecule scenarios (#191)
* Use distro specific Ansible modules to install NGINX

* Install NGINX directly in Alpine distributions from the official repository to avoid naming conflicts

* Set travis_wait parameter to max timeout setting
2019-11-24 02:10:55 +01:00

25 lines
825 B
YAML

---
- 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) }}"
- name: "(Install: CentOS/RedHat) Add NGINX Repository"
yum_repository:
name: nginx
baseurl: "{{ repository }}"
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"