fix: Linting.
This commit is contained in:
parent
4ea9fd1142
commit
28c32a767f
@ -1,10 +1,12 @@
|
||||
---
|
||||
exclude_paths:
|
||||
- .cache/
|
||||
- ./molecule
|
||||
- ./.travis.yml
|
||||
- ./.github
|
||||
parseable: true
|
||||
skip_list:
|
||||
- '204'
|
||||
- 'no-handler'
|
||||
use_default_rules: true
|
||||
verbosity: 1
|
||||
|
@ -21,7 +21,9 @@
|
||||
when: "not docker_sock_stat.stat.exists"
|
||||
|
||||
- name: "UNIFI-CONTROLLER | Update apt cache."
|
||||
ansible.builtin.apt: update_cache=yes cache_valid_time=600
|
||||
ansible.builtin.apt:
|
||||
update_cache: yes
|
||||
cache_valid_time: 600
|
||||
when: "ansible_os_family == 'Debian'"
|
||||
|
||||
- name: "UNIFI-CONTROLLER | Install python requests"
|
||||
|
@ -1,4 +1,4 @@
|
||||
---
|
||||
roles:
|
||||
- "geerlingguy.docker"
|
||||
- name: "geerlingguy.docker"
|
||||
collections: []
|
||||
|
@ -1,59 +0,0 @@
|
||||
---
|
||||
# This is an example playbook to execute goss tests.
|
||||
# Tests need distributed to the appropriate ansible host/groups
|
||||
# prior to execution by `goss validate`.
|
||||
|
||||
- name: Verify unifi-controller
|
||||
hosts:
|
||||
- "unifi-controller"
|
||||
become: true
|
||||
vars:
|
||||
goss_version: "v0.3.16"
|
||||
goss_arch: "amd64"
|
||||
goss_dst: "/usr/local/bin/goss"
|
||||
goss_sha256sum: "827e354b48f93bce933f5efcd1f00dc82569c42a179cf2d384b040d8a80bfbfb"
|
||||
goss_url: "https://github.com/aelsabbahy/goss/releases/download/{{ goss_version }}/goss-linux-{{ goss_arch }}"
|
||||
goss_test_directory:" /tmp"
|
||||
goss_format: "documentation"
|
||||
|
||||
vars_files:
|
||||
- ../../defaults/main.yml
|
||||
|
||||
tasks:
|
||||
- name: "UNIFI-CONTROLLER | Download and install Goss"
|
||||
get_url:
|
||||
url: "{{ goss_url }}"
|
||||
dest: "{{ goss_dst }}"
|
||||
checksum: "sha256:{{ goss_sha256sum }}"
|
||||
mode: 0755
|
||||
register: "download_goss"
|
||||
until: "download_goss is succeeded"
|
||||
retries: 3
|
||||
|
||||
- name: "UNIFI-CONTROLLER | Copy Goss tests to remote"
|
||||
template:
|
||||
src: "{{ item }}"
|
||||
dest: "{{ goss_test_directory }}/{{ item | basename }}"
|
||||
with_fileglob:
|
||||
- "tests/test_*.yml"
|
||||
|
||||
- name: "UNIFI-CONTROLLER | Register test files"
|
||||
shell: "ls {{ goss_test_directory }}/test_*.yml"
|
||||
register: "test_files"
|
||||
|
||||
- name: "UNIFI-CONTROLLER | Execute Goss tests"
|
||||
command: "{{ goss_dst }} -g {{ item }} validate --format {{ goss_format }}"
|
||||
register: "test_results"
|
||||
with_items: "{{ test_files.stdout_lines }}"
|
||||
ignore_errors: true
|
||||
|
||||
- name: "UNIFI-CONTROLLER | Display details about the Goss results"
|
||||
debug:
|
||||
msg: "{{ item.stdout_lines }}"
|
||||
with_items: "{{ test_results.results }}"
|
||||
|
||||
- name: "UNIFI-CONTROLLER | Fail when tests fail"
|
||||
fail:
|
||||
msg: "Goss failed to validate"
|
||||
when: item.rc != 0
|
||||
with_items: "{{ test_results.results }}"
|
@ -21,4 +21,3 @@
|
||||
- "{{ unifi_configuration_files }}"
|
||||
tags:
|
||||
- unifi_configure
|
||||
|
@ -1,11 +1,11 @@
|
||||
---
|
||||
|
||||
- name: "UNIFI-CONTROLLER | Configure"
|
||||
import_tasks: config.yml
|
||||
ansible.builtin.import_tasks: config.yml
|
||||
tags:
|
||||
- unifi_configure
|
||||
|
||||
- name: "UNIFI-CONTROLLER | Install"
|
||||
import_tasks: install.yml
|
||||
ansible.builtin.import_tasks: install.yml
|
||||
tags:
|
||||
- unifi_install
|
||||
|
@ -3,5 +3,5 @@ ansible==8.3.0
|
||||
molecule==6.0.2
|
||||
docker==6.1.3
|
||||
molecule-docker==2.1.0
|
||||
ansible-lint==6.19.0
|
||||
ansible-lint==6.20.0
|
||||
yamllint==1.32.0
|
Loading…
Reference in New Issue
Block a user