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

29 lines
1.0 KiB
YAML
Raw Normal View History

2018-01-10 23:40:01 +01:00
---
- name: "(Install: Debian/Ubuntu) Set Default APT NGINX Repository"
set_fact:
default_repository:
- >-
deb [arch=amd64] https://nginx.org/packages/{{ (nginx_branch == 'mainline')
| ternary('mainline/', '') }}{{ ansible_distribution | lower }}/ {{ ansible_distribution_release }} nginx
- >-
deb-src https://nginx.org/packages/{{ (nginx_branch == 'mainline')
| ternary('mainline/', '') }}{{ ansible_distribution | lower }}/ {{ ansible_distribution_release }} nginx
- name: "(Install: Debian/Ubuntu) Set APT NGINX Repository"
set_fact:
repository: "{{ nginx_repository | default(default_repository) }}"
2018-05-12 00:12:06 +02:00
- name: "(Install: Debian/Ubuntu) Add NGINX Repository"
2018-01-10 23:40:01 +01:00
apt_repository:
filename: nginx
2018-01-10 23:40:01 +01:00
repo: "{{ item }}"
update_cache: yes
mode: 0644
loop: "{{ repository }}"
- name: "(Install: Debian/Ubuntu) Install NGINX"
apt:
name: "nginx{{ nginx_version | default('') }}"
state: "{{ nginx_state }}"
notify: "(Handler: All OSs) Start NGINX"