refactor ansible code in to ansible-2.0 folder, and created space for ansible-2.10
This commit is contained in:
4
ansible-2.0/roles/nginx/defaults/main.yml
Normal file
4
ansible-2.0/roles/nginx/defaults/main.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
# defaults/main.yml
|
||||
# define default variable values here
|
||||
|
||||
12
ansible-2.0/roles/nginx/handlers/main.yml
Normal file
12
ansible-2.0/roles/nginx/handlers/main.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
# handlers/main.yml
|
||||
# define handlers here
|
||||
|
||||
#- name: restart <service>
|
||||
# service: name=<service> state=restarted
|
||||
|
||||
#- name: stop <service>
|
||||
# service: name=<service> state=stopped
|
||||
|
||||
- name: reload nginx
|
||||
service: name=nginx state=reloaded
|
||||
8
ansible-2.0/roles/nginx/meta/main.yml
Normal file
8
ansible-2.0/roles/nginx/meta/main.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
# meta/main.yml
|
||||
# define dependancies here
|
||||
|
||||
# dependencies:
|
||||
# - { role: geerlingguy.java }
|
||||
|
||||
dependencies: []
|
||||
16
ansible-2.0/roles/nginx/tasks/main.yml
Normal file
16
ansible-2.0/roles/nginx/tasks/main.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
# tasks/main.yml
|
||||
# define tasks here
|
||||
|
||||
- name: Install the nginx packages
|
||||
apt: name={{ item }} state=present
|
||||
with_items:
|
||||
- nginx
|
||||
|
||||
# - name: Ensure log directory exist
|
||||
# file: path=/etc/nginx/sites-enabled state=directory mode=0644
|
||||
|
||||
- name: Copy the nginx configuration file
|
||||
template: src=nginx.conf.j2 dest=/etc/nginx/nginx.conf
|
||||
notify:
|
||||
- reload nginx
|
||||
49
ansible-2.0/roles/nginx/templates/nginx.conf.j2
Normal file
49
ansible-2.0/roles/nginx/templates/nginx.conf.j2
Normal file
@@ -0,0 +1,49 @@
|
||||
user root;
|
||||
worker_processes 8;
|
||||
worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 01000000 10000000;
|
||||
pid /var/run/nginx.pid;
|
||||
worker_rlimit_nofile 65535;
|
||||
|
||||
events {
|
||||
use epoll;
|
||||
worker_connections 65535;
|
||||
}
|
||||
|
||||
http {
|
||||
server_tokens off;
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format full '$remote_addr - $remote_user [$time_local] '
|
||||
'"$request" $status $body_bytes_sent '
|
||||
'"$http_referer" "$http_user_agent" "$http_x_forwarded_for" $request_time';
|
||||
|
||||
|
||||
charset utf-8;
|
||||
|
||||
server_names_hash_bucket_size 128;
|
||||
client_header_buffer_size 32k;
|
||||
large_client_header_buffers 4 64k;
|
||||
client_max_body_size 8m;
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 60;
|
||||
|
||||
open_file_cache max=65535 inactive=10s;
|
||||
open_file_cache_valid 30s;
|
||||
open_file_cache_min_uses 1;
|
||||
|
||||
gzip on;
|
||||
gzip_min_length 1k;
|
||||
gzip_buffers 4 16k;
|
||||
gzip_http_version 1.0;
|
||||
gzip_comp_level 2;
|
||||
gzip_types text/plain application/javascript text/css application/xml application/json;
|
||||
gzip_vary on;
|
||||
|
||||
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
include /etc/nginx/sites-enabled/*;
|
||||
}
|
||||
10
ansible-2.0/roles/nginx/vars/_extravars.yml
Normal file
10
ansible-2.0/roles/nginx/vars/_extravars.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
# vars/_extravars.yml
|
||||
# define extra variable values here
|
||||
# this file should be loaded via an include_vars statement in the task.
|
||||
# often this is used for managing differences in os.
|
||||
|
||||
# Variable setup.
|
||||
#- name: Include OS-Specific variables
|
||||
# include_vars: "{{ ansible_os_family }}.yml"
|
||||
|
||||
Reference in New Issue
Block a user