use upstream nginx package
This commit is contained in:
12
roles/nginx/tasks/Debian.yaml
Normal file
12
roles/nginx/tasks/Debian.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
---
|
||||
- name: install nginx apt key
|
||||
apt_key:
|
||||
keyserver: keyserver.ubuntu.com
|
||||
id: "{{ nginx_repo_key_id }}"
|
||||
|
||||
- name: install nginx apt repo
|
||||
apt_repository:
|
||||
repo: "deb http://nginx.org/packages/mainline/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} nginx"
|
||||
update_cache: yes
|
||||
filename: nginx
|
||||
state: "{{ nginx_repo_state }}"
|
@ -1,4 +1,28 @@
|
||||
---
|
||||
- name: gather os specific variables
|
||||
include_vars: "{{ lookup('first_found', possible_files) }}"
|
||||
vars:
|
||||
possible_files:
|
||||
files:
|
||||
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml"
|
||||
- "{{ ansible_distribution }}.yaml"
|
||||
- "{{ ansible_os_family }}.yaml"
|
||||
- "default.yaml"
|
||||
paths:
|
||||
- vars
|
||||
|
||||
- name: include os specific tasks
|
||||
include_tasks: "{{ lookup('first_found', possible_files) }}"
|
||||
vars:
|
||||
possible_files:
|
||||
files:
|
||||
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml"
|
||||
- "{{ ansible_distribution }}.yaml"
|
||||
- "{{ ansible_os_family }}.yaml"
|
||||
- "default.yaml"
|
||||
paths:
|
||||
- tasks
|
||||
|
||||
- name: install passlib
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
@ -12,10 +36,10 @@
|
||||
name: "{{ nginx_package_name }}"
|
||||
state: "{{ nginx_package_state }}"
|
||||
|
||||
- name: configure default virtual host
|
||||
- name: configure nginx
|
||||
template:
|
||||
src: default.j2
|
||||
dest: /etc/nginx/sites-available/default
|
||||
src: nginx.conf.j2
|
||||
dest: "{{ nginx_etc_path }}/nginx.conf"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
Reference in New Issue
Block a user