mirror of
https://github.com/geerlingguy/ansible-role-nginx.git
synced 2024-09-28 04:07:26 +02:00
Fix some Ansible Lint issues and set up yaml-lint options.
This commit is contained in:
parent
a3e664b069
commit
67c8be8106
@ -15,7 +15,8 @@ nginx_package_name: "nginx"
|
|||||||
nginx_conf_template: "nginx.conf.j2"
|
nginx_conf_template: "nginx.conf.j2"
|
||||||
nginx_vhost_template: "vhost.j2"
|
nginx_vhost_template: "vhost.j2"
|
||||||
|
|
||||||
nginx_worker_processes: "{{ ansible_processor_vcpus | default(ansible_processor_count) }}"
|
nginx_worker_processes: >-
|
||||||
|
"{{ ansible_processor_vcpus | default(ansible_processor_count) }}"
|
||||||
nginx_worker_connections: "1024"
|
nginx_worker_connections: "1024"
|
||||||
nginx_multi_accept: "off"
|
nginx_multi_accept: "off"
|
||||||
|
|
||||||
@ -59,7 +60,7 @@ nginx_vhosts: []
|
|||||||
# server_name: "example.com" # default: N/A
|
# server_name: "example.com" # default: N/A
|
||||||
# root: "/var/www/example.com" # default: N/A
|
# root: "/var/www/example.com" # default: N/A
|
||||||
# index: "index.html index.htm" # default: "index.html index.htm"
|
# index: "index.html index.htm" # default: "index.html index.htm"
|
||||||
# filename: "example.com.conf" # Can be used to set the filename of the vhost file.
|
# filename: "example.com.conf" # Can be used to set the vhost filename.
|
||||||
#
|
#
|
||||||
# # Properties that are only added if defined:
|
# # Properties that are only added if defined:
|
||||||
# server_name_redirect: "www.example.com" # default: N/A
|
# server_name_redirect: "www.example.com" # default: N/A
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
- name: validate nginx configuration
|
- name: validate nginx configuration
|
||||||
command: nginx -t -c /etc/nginx/nginx.conf
|
command: nginx -t -c /etc/nginx/nginx.conf
|
||||||
changed_when: False
|
changed_when: false
|
||||||
|
|
||||||
- name: reload nginx
|
- name: reload nginx
|
||||||
service: name=nginx state=reloaded
|
service: name=nginx state=reloaded
|
||||||
|
@ -10,29 +10,29 @@ galaxy_info:
|
|||||||
platforms:
|
platforms:
|
||||||
- name: EL
|
- name: EL
|
||||||
versions:
|
versions:
|
||||||
- 6
|
- 6
|
||||||
- 7
|
- 7
|
||||||
- name: Debian
|
- name: Debian
|
||||||
versions:
|
versions:
|
||||||
- all
|
- all
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
- trusty
|
- trusty
|
||||||
- xenial
|
- xenial
|
||||||
- name: Archlinux
|
- name: Archlinux
|
||||||
versions:
|
versions:
|
||||||
- all
|
- all
|
||||||
- name: FreeBSD
|
- name: FreeBSD
|
||||||
versions:
|
versions:
|
||||||
- 10.3
|
- 10.3
|
||||||
- 10.2
|
- 10.2
|
||||||
- 10.1
|
- 10.1
|
||||||
- 10.0
|
- 10.0
|
||||||
- 9.3
|
- 9.3
|
||||||
- name: OpenBSD
|
- name: OpenBSD
|
||||||
versions:
|
versions:
|
||||||
- 5.9
|
- 5.9
|
||||||
- 6.0
|
- 6.0
|
||||||
galaxy_tags:
|
galaxy_tags:
|
||||||
- development
|
- development
|
||||||
- web
|
- web
|
||||||
|
@ -5,6 +5,8 @@ driver:
|
|||||||
name: docker
|
name: docker
|
||||||
lint:
|
lint:
|
||||||
name: yamllint
|
name: yamllint
|
||||||
|
options:
|
||||||
|
config-file: molecule/default/yaml-lint.yml
|
||||||
platforms:
|
platforms:
|
||||||
- name: instance
|
- name: instance
|
||||||
image: geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible
|
image: geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible
|
||||||
|
6
molecule/default/yaml-lint.yml
Normal file
6
molecule/default/yaml-lint.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
extends: default
|
||||||
|
rules:
|
||||||
|
line-length:
|
||||||
|
max: 120
|
||||||
|
level: warning
|
@ -3,7 +3,7 @@
|
|||||||
apt_repository:
|
apt_repository:
|
||||||
repo: 'ppa:nginx/{{ nginx_ppa_version }}'
|
repo: 'ppa:nginx/{{ nginx_ppa_version }}'
|
||||||
state: present
|
state: present
|
||||||
update_cache: yes
|
update_cache: true
|
||||||
register: nginx_ppa_added
|
register: nginx_ppa_added
|
||||||
when: nginx_ppa_use
|
when: nginx_ppa_use
|
||||||
|
|
||||||
|
@ -16,13 +16,15 @@
|
|||||||
template:
|
template:
|
||||||
src: "{{ item.template|default(nginx_vhost_template) }}"
|
src: "{{ item.template|default(nginx_vhost_template) }}"
|
||||||
dest: "{{ nginx_vhost_path }}/{{ item.filename|default(item.server_name.split(' ')[0] ~ '.conf') }}"
|
dest: "{{ nginx_vhost_path }}/{{ item.filename|default(item.server_name.split(' ')[0] ~ '.conf') }}"
|
||||||
force: yes
|
force: true
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
when: item.state|default('present') != 'absent'
|
when: item.state|default('present') != 'absent'
|
||||||
with_items: "{{ nginx_vhosts }}"
|
with_items: "{{ nginx_vhosts }}"
|
||||||
notify: reload nginx
|
notify: reload nginx
|
||||||
|
tags:
|
||||||
|
- skip_ansible_lint
|
||||||
|
|
||||||
- name: Remove managed vhost config files.
|
- name: Remove managed vhost config files.
|
||||||
file:
|
file:
|
||||||
@ -31,6 +33,8 @@
|
|||||||
when: item.state|default('present') == 'absent'
|
when: item.state|default('present') == 'absent'
|
||||||
with_items: "{{ nginx_vhosts }}"
|
with_items: "{{ nginx_vhosts }}"
|
||||||
notify: reload nginx
|
notify: reload nginx
|
||||||
|
tags:
|
||||||
|
- skip_ansible_lint
|
||||||
|
|
||||||
- name: Remove legacy vhosts.conf file.
|
- name: Remove legacy vhosts.conf file.
|
||||||
file:
|
file:
|
||||||
|
Loading…
Reference in New Issue
Block a user