mirror of
https://github.com/geerlingguy/ansible-role-nginx.git
synced 2024-06-22 09:55:03 +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_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_multi_accept: "off"
|
||||
|
||||
|
@ -59,7 +60,7 @@ nginx_vhosts: []
|
|||
# server_name: "example.com" # default: N/A
|
||||
# root: "/var/www/example.com" # default: N/A
|
||||
# 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:
|
||||
# server_name_redirect: "www.example.com" # default: N/A
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
- name: validate nginx configuration
|
||||
command: nginx -t -c /etc/nginx/nginx.conf
|
||||
changed_when: False
|
||||
changed_when: false
|
||||
|
||||
- name: reload nginx
|
||||
service: name=nginx state=reloaded
|
||||
|
|
|
@ -10,29 +10,29 @@ galaxy_info:
|
|||
platforms:
|
||||
- name: EL
|
||||
versions:
|
||||
- 6
|
||||
- 7
|
||||
- 6
|
||||
- 7
|
||||
- name: Debian
|
||||
versions:
|
||||
- all
|
||||
- all
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- trusty
|
||||
- xenial
|
||||
- trusty
|
||||
- xenial
|
||||
- name: Archlinux
|
||||
versions:
|
||||
- all
|
||||
- all
|
||||
- name: FreeBSD
|
||||
versions:
|
||||
- 10.3
|
||||
- 10.2
|
||||
- 10.1
|
||||
- 10.0
|
||||
- 9.3
|
||||
- 10.3
|
||||
- 10.2
|
||||
- 10.1
|
||||
- 10.0
|
||||
- 9.3
|
||||
- name: OpenBSD
|
||||
versions:
|
||||
- 5.9
|
||||
- 6.0
|
||||
- 5.9
|
||||
- 6.0
|
||||
galaxy_tags:
|
||||
- development
|
||||
- web
|
||||
|
|
|
@ -5,6 +5,8 @@ driver:
|
|||
name: docker
|
||||
lint:
|
||||
name: yamllint
|
||||
options:
|
||||
config-file: molecule/default/yaml-lint.yml
|
||||
platforms:
|
||||
- name: instance
|
||||
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:
|
||||
repo: 'ppa:nginx/{{ nginx_ppa_version }}'
|
||||
state: present
|
||||
update_cache: yes
|
||||
update_cache: true
|
||||
register: nginx_ppa_added
|
||||
when: nginx_ppa_use
|
||||
|
||||
|
|
|
@ -16,13 +16,15 @@
|
|||
template:
|
||||
src: "{{ item.template|default(nginx_vhost_template) }}"
|
||||
dest: "{{ nginx_vhost_path }}/{{ item.filename|default(item.server_name.split(' ')[0] ~ '.conf') }}"
|
||||
force: yes
|
||||
force: true
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
when: item.state|default('present') != 'absent'
|
||||
with_items: "{{ nginx_vhosts }}"
|
||||
notify: reload nginx
|
||||
tags:
|
||||
- skip_ansible_lint
|
||||
|
||||
- name: Remove managed vhost config files.
|
||||
file:
|
||||
|
@ -31,6 +33,8 @@
|
|||
when: item.state|default('present') == 'absent'
|
||||
with_items: "{{ nginx_vhosts }}"
|
||||
notify: reload nginx
|
||||
tags:
|
||||
- skip_ansible_lint
|
||||
|
||||
- name: Remove legacy vhosts.conf file.
|
||||
file:
|
||||
|
|
Loading…
Reference in New Issue
Block a user