nginx_com -> nginx_org
This commit is contained in:
parent
1cc1f240bb
commit
c301a2b1a1
|
@ -2,12 +2,12 @@
|
||||||
nginx_enabled: True
|
nginx_enabled: True
|
||||||
nginx_use_ppa: False
|
nginx_use_ppa: False
|
||||||
nginx_ppa_repo: ppa:nginx/stable
|
nginx_ppa_repo: ppa:nginx/stable
|
||||||
nginx_use_nginx_com_repo: False
|
nginx_use_nginx_org_repo: False
|
||||||
nginx_com_repo_key: 'https://nginx.org/keys/nginx_signing.key'
|
nginx_org_repo_key: 'https://nginx.org/keys/nginx_signing.key'
|
||||||
nginx_com_repo: 'deb http://nginx.org/packages/ubuntu/ bionic nginx'
|
nginx_org_repo: 'deb http://nginx.org/packages/ubuntu/ bionic nginx'
|
||||||
nginx_package_state: present
|
nginx_package_state: present
|
||||||
|
|
||||||
nginx_com_modules: []
|
nginx_org_modules: []
|
||||||
# - pkg_name: nginx-module-njs
|
# - pkg_name: nginx-module-njs
|
||||||
# mod_name: ngx_http_js_module.so
|
# mod_name: ngx_http_js_module.so
|
||||||
# enabled: yes
|
# enabled: yes
|
||||||
|
|
|
@ -34,10 +34,10 @@
|
||||||
copy:
|
copy:
|
||||||
content: "load_module modules/{{ item.mod_name }};"
|
content: "load_module modules/{{ item.mod_name }};"
|
||||||
dest: /etc/nginx/modules-available/{{ item.pkg_name }}.conf
|
dest: /etc/nginx/modules-available/{{ item.pkg_name }}.conf
|
||||||
loop: '{{ nginx_com_modules }}'
|
loop: '{{ nginx_org_modules }}'
|
||||||
when:
|
when:
|
||||||
- item.enabled
|
- item.enabled
|
||||||
- nginx_use_nginx_com_repo
|
- nginx_use_nginx_org_repo
|
||||||
|
|
||||||
- name: Enable the additional modules
|
- name: Enable the additional modules
|
||||||
file:
|
file:
|
||||||
|
@ -45,20 +45,20 @@
|
||||||
dest: /etc/nginx/modules-enabled/{{ item.pkg_name }}.conf
|
dest: /etc/nginx/modules-enabled/{{ item.pkg_name }}.conf
|
||||||
state: link
|
state: link
|
||||||
when: item.enabled
|
when: item.enabled
|
||||||
loop: '{{ nginx_com_modules }}'
|
loop: '{{ nginx_org_modules }}'
|
||||||
|
|
||||||
- name: Disable the additional modules that we do not want installed
|
- name: Disable the additional modules that we do not want installed
|
||||||
file:
|
file:
|
||||||
dest: /etc/nginx/modules-enabled/{{ item.pkg_name }}.conf
|
dest: /etc/nginx/modules-enabled/{{ item.pkg_name }}.conf
|
||||||
state: absent
|
state: absent
|
||||||
when: not item.enabled
|
when: not item.enabled
|
||||||
loop: '{{ nginx_com_modules }}'
|
loop: '{{ nginx_org_modules }}'
|
||||||
|
|
||||||
- name: Remove the default configuration when using the nginx.com repository
|
- name: Remove the default configuration when using the nginx.com repository
|
||||||
file:
|
file:
|
||||||
dest: /etc/nginx/conf.d/default.conf
|
dest: /etc/nginx/conf.d/default.conf
|
||||||
state: absent
|
state: absent
|
||||||
when: nginx_use_nginx_com_repo
|
when: nginx_use_nginx_org_repo
|
||||||
|
|
||||||
- name: Install the main nginx.conf
|
- name: Install the main nginx.conf
|
||||||
template: src=nginx.conf.j2 dest=/etc/nginx/nginx.conf mode=444
|
template: src=nginx.conf.j2 dest=/etc/nginx/nginx.conf mode=444
|
||||||
|
|
|
@ -9,22 +9,22 @@
|
||||||
|
|
||||||
- name: Install the key of the nginx.com repository
|
- name: Install the key of the nginx.com repository
|
||||||
apt_key:
|
apt_key:
|
||||||
url: '{{ nginx_com_repo_key }}'
|
url: '{{ nginx_org_repo_key }}'
|
||||||
state: present
|
state: present
|
||||||
when:
|
when:
|
||||||
- nginx_use_nginx_com_repo
|
- nginx_use_nginx_org_repo
|
||||||
- ansible_distribution == 'Ubuntu'
|
- ansible_distribution == 'Ubuntu'
|
||||||
tags: [ 'nginx', 'nginx_com_ppa' ]
|
tags: [ 'nginx', 'nginx_org_ppa' ]
|
||||||
|
|
||||||
- name: Install the nginx.com repository configuration
|
- name: Install the nginx.com repository configuration
|
||||||
apt_repository:
|
apt_repository:
|
||||||
repo: '{{ nginx_com_repo }}'
|
repo: '{{ nginx_org_repo }}'
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
filename: nginx_com
|
filename: nginx_org
|
||||||
when:
|
when:
|
||||||
- nginx_use_nginx_com_repo
|
- nginx_use_nginx_org_repo
|
||||||
- ansible_distribution == 'Ubuntu'
|
- ansible_distribution == 'Ubuntu'
|
||||||
tags: [ 'nginx', 'nginx_com_ppa' ]
|
tags: [ 'nginx', 'nginx_org_ppa' ]
|
||||||
|
|
||||||
- name: Install the nginx web server
|
- name: Install the nginx web server
|
||||||
apt: pkg=nginx-full state={{ nginx_package_state }} cache_valid_time=1800
|
apt: pkg=nginx-full state={{ nginx_package_state }} cache_valid_time=1800
|
||||||
|
@ -50,9 +50,9 @@
|
||||||
pkg: '{{ item.pkg_name }}'
|
pkg: '{{ item.pkg_name }}'
|
||||||
state: present
|
state: present
|
||||||
cache_valid_time: 1800
|
cache_valid_time: 1800
|
||||||
loop: '{{ nginx_com_modules }}'
|
loop: '{{ nginx_org_modules }}'
|
||||||
when:
|
when:
|
||||||
- nginx_use_nginx_com_repo
|
- nginx_use_nginx_org_repo
|
||||||
- ansible_distribution_major_version >= '16'
|
- ansible_distribution_major_version >= '16'
|
||||||
|
|
||||||
when: ansible_distribution_file_variety == "Debian"
|
when: ansible_distribution_file_variety == "Debian"
|
||||||
|
|
Loading…
Reference in New Issue