2020-06-02 14:52:24 +02:00
|
|
|
---
|
|
|
|
- block:
|
|
|
|
- name: Install the Ubuntu PPA for nginx
|
|
|
|
apt_repository: repo='{{ nginx_ppa_repo }}' update_cache=yes
|
|
|
|
when:
|
|
|
|
- nginx_use_ppa
|
2021-05-27 19:41:22 +02:00
|
|
|
- ansible_distribution == 'Ubuntu'
|
2020-06-02 14:52:24 +02:00
|
|
|
tags: [ 'nginx', 'nginx_ppa' ]
|
|
|
|
|
2021-05-27 19:41:22 +02:00
|
|
|
- name: Install the key of the nginx.com repository
|
|
|
|
apt_key:
|
2021-05-29 12:01:21 +02:00
|
|
|
url: '{{ nginx_org_repo_key }}'
|
2021-05-27 19:41:22 +02:00
|
|
|
state: present
|
|
|
|
when:
|
2021-05-29 12:01:21 +02:00
|
|
|
- nginx_use_nginx_org_repo
|
2021-05-27 19:41:22 +02:00
|
|
|
- ansible_distribution == 'Ubuntu'
|
2021-05-29 12:01:21 +02:00
|
|
|
tags: [ 'nginx', 'nginx_org_ppa' ]
|
2021-05-27 19:41:22 +02:00
|
|
|
|
|
|
|
- name: Install the nginx.com repository configuration
|
|
|
|
apt_repository:
|
2021-05-29 12:01:21 +02:00
|
|
|
repo: '{{ nginx_org_repo }}'
|
2021-05-27 19:41:22 +02:00
|
|
|
update_cache: yes
|
2021-05-29 12:01:21 +02:00
|
|
|
filename: nginx_org
|
2021-05-27 19:41:22 +02:00
|
|
|
when:
|
2021-05-29 12:01:21 +02:00
|
|
|
- nginx_use_nginx_org_repo
|
2021-05-27 19:41:22 +02:00
|
|
|
- ansible_distribution == 'Ubuntu'
|
2021-05-29 12:01:21 +02:00
|
|
|
tags: [ 'nginx', 'nginx_org_ppa' ]
|
2021-05-27 19:41:22 +02:00
|
|
|
|
2020-06-02 14:52:24 +02:00
|
|
|
- name: Install the nginx web server
|
|
|
|
apt: pkg=nginx-full state={{ nginx_package_state }} cache_valid_time=1800
|
|
|
|
when:
|
|
|
|
- not nginx_use_ldap_pam_auth
|
|
|
|
- ansible_distribution_major_version <= '14'
|
|
|
|
|
|
|
|
- name: Install the nginx web server if we need ldap auth via pam
|
|
|
|
apt: pkg=nginx-extras state={{ nginx_package_state }} cache_valid_time=1800
|
|
|
|
when:
|
|
|
|
- nginx_use_ldap_pam_auth
|
|
|
|
- ansible_distribution_major_version <= '14'
|
|
|
|
|
|
|
|
- name: Install the nginx web server on Ubuntu >= 16.04
|
2021-05-27 19:41:22 +02:00
|
|
|
apt:
|
|
|
|
pkg: nginx
|
|
|
|
state: present
|
|
|
|
cache_valid_time: 1800
|
2020-06-02 14:52:24 +02:00
|
|
|
when: ansible_distribution_major_version >= '16'
|
|
|
|
|
2021-05-27 19:41:22 +02:00
|
|
|
- name: Install the nginx.com additional modules
|
|
|
|
apt:
|
|
|
|
pkg: '{{ item.pkg_name }}'
|
|
|
|
state: present
|
|
|
|
cache_valid_time: 1800
|
2021-05-29 12:01:21 +02:00
|
|
|
loop: '{{ nginx_org_modules }}'
|
2021-05-27 19:41:22 +02:00
|
|
|
when:
|
2021-05-29 12:01:21 +02:00
|
|
|
- nginx_use_nginx_org_repo
|
2021-05-27 19:41:22 +02:00
|
|
|
- ansible_distribution_major_version >= '16'
|
|
|
|
|
2020-06-02 14:52:24 +02:00
|
|
|
when: ansible_distribution_file_variety == "Debian"
|
2021-05-27 19:41:22 +02:00
|
|
|
tags: [ nginx ]
|