Fix some Ansible Lint issues and set up yaml-lint options.

pull/129/head^2
Jeff Geerling 4 years ago
parent a3e664b069
commit 67c8be8106
  1. 5
      defaults/main.yml
  2. 2
      handlers/main.yml
  3. 26
      meta/main.yml
  4. 2
      molecule/default/molecule.yml
  5. 6
      molecule/default/yaml-lint.yml
  6. 2
      tasks/setup-Ubuntu.yml
  7. 6
      tasks/vhosts.yml

@ -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

@ -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: