1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_avahi_client.git synced 2024-07-06 22:39:00 +02:00

improve linting

This commit is contained in:
L3D 2023-04-25 23:52:04 +02:00
parent 540c03e548
commit 99faf1c0eb
No known key found for this signature in database
GPG key ID: AD65B920933B4B20
6 changed files with 36 additions and 24 deletions

View file

@ -10,13 +10,18 @@ on:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'checkout git repo'
uses: actions/checkout@v3
with:
lfs: true
submodules: true
fetch-depth: 0
- name: 'Lint Ansible Playbook'
uses: ansible/ansible-lint-action@v6
with:
targets: "."
path: "."

View file

@ -2,21 +2,25 @@
galaxy_info:
role_name: avahi_client
author: do1jlr
description: Avahi provides local hostname resolution using a "hostname.local" naming scheme.
description: Avahi provides local hostname resolution using the ".local" MDNS Domain.
license: "MIT"
min_ansible_version: 2.11
github_branch: main
min_ansible_version: "2.12"
platforms:
- name: Archlinux
versions: all
- name: ArchLinux
versions: ['all']
- name: Debian
versions: all
versions: ['all']
- name: Ubuntu
versions: all
versions: ['all']
- name: EL
versions: ['all']
- name: Fedora
versions: ['all']
galaxy_tags:
- avahi
- client
- local
- mdns
- bonjour
- linux
dependencies: []

View file

@ -1,17 +1,17 @@
---
- name: run optional versionscheck
- name: Run Optional versionscheck
ansible.builtin.include_tasks: versioncheck.yml
when: submodules_versioncheck|bool
when: submodules_versioncheck | bool
- name: gather os specific variables
- name: Gather os specific variables
ansible.builtin.include_vars: "{{ item }}"
with_first_found:
- "vars/{{ ansible_os_family }}.yml"
- "vars/os_fallback.yml"
- name: install mdns requirements
- name: Install MDNS requirements
ansible.builtin.include_tasks: install.yml
- name: configure /etc/nsswitch.conf
- name: Configure /etc/nsswitch.conf
ansible.builtin.include_tasks: nsswitch.yml
when: avahi_client__configure_nsswitch | bool

View file

@ -8,37 +8,38 @@
path: '/etc/.ansible-version'
state: directory
mode: 0755
when: submodules_versioncheck|bool
when: submodules_versioncheck | bool
- name: check playbook version
- name: Check playbook version
become: true
ansible.builtin.slurp:
src: "/etc/.ansible-version/{{ playbook_version_path }}"
register: playbook_version
when: submodules_versioncheck|bool
when: submodules_versioncheck | bool
ignore_errors: true
failed_when: false
- name: Print remote role version
ansible.builtin.debug:
msg: "Remote role version: {{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}"
when: submodules_versioncheck|bool
when: submodules_versioncheck | bool
- name: Print locale role version
ansible.builtin.debug:
msg: "Local role version: '{{ playbook_version_number|string }}'."
when: submodules_versioncheck|bool
msg: "Local role version: '{{ playbook_version_number | string }}'."
when: submodules_versioncheck | bool
- name: Check if your version is outdated
ansible.builtin.fail:
msg: "Your ansible module has the version '{{ playbook_version_number }}' and is outdated. You need to update it!"
when:
- playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck|bool
- playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck | bool
- name: write new version to remote disk
- name: Write new version to remote disk
become: true
ansible.builtin.copy:
content: "{{ playbook_version_number }}"
dest: "/etc/.ansible-version/{{ playbook_version_path }}"
mode: '0644'
when: submodules_versioncheck|bool
when: submodules_versioncheck | bool
tags: skip_ansible_lint_template-instead-of-copy

View file

@ -1,6 +1,9 @@
# /etc/nsswitch.conf
# {{ ansible_managed }}
#
# See https://galaxy.ansible.com/l3d/avahi_client and
# https://galaxy.ansible.com/l3d/avahi for more details
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

View file

@ -1,4 +1,3 @@
---
# versionscheck
playbook_version_number: 7
playbook_version_number: 8
playbook_version_path: 'do1jlr.avahi_client.version'