From 3635fbf72cca35b4660d9d8ba42378b91118abfd Mon Sep 17 00:00:00 2001 From: L3D Date: Sat, 27 Apr 2024 02:49:52 +0200 Subject: [PATCH] Improve linting --- README.md | 2 +- defaults/main.yml | 2 +- tasks/main.yml | 2 +- tasks/versioncheck.yml | 22 +++++++++++----------- vars/main.yml | 12 ++++++------ 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 2f1681c..e43cb9b 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ By default it will also add the [ETH Zürich Debian Packages Mirror](https://deb | ``packages__ethz_security`` | ``true`` | Inofficial Debian Security Mirror | | ``packages__ethz_updates`` | ``true`` | Updates Mirror | | ``packages__ethz__backports`` | ``true`` | Backports Mirror | -| ``submodules_versioncheck`` | ``false`` | Enable simple versioncheck to prevent running old versions of this role | +| ``packages__submodules_versioncheck`` | ``false`` | Enable simple versioncheck to prevent running old versions of this role | Contributing ------------- diff --git a/defaults/main.yml b/defaults/main.yml index 081ea1d..1f401c8 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -20,4 +20,4 @@ packages__install_cli: false packages__install_extra_packages: [] # Optional perform simple Versionscheck -submodules_versioncheck: false +packages__submodules_versioncheck: false diff --git a/tasks/main.yml b/tasks/main.yml index ec1af28..a85f1f1 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -6,7 +6,7 @@ - name: Run simple versionscheck (optional) ansible.builtin.include_tasks: file: 'versioncheck.yml' - when: submodules_versioncheck | bool + when: packages__submodules_versioncheck | bool - name: Adding additional apt sources (optional) ansible.builtin.include_tasks: diff --git a/tasks/versioncheck.yml b/tasks/versioncheck.yml index 1ccdbf0..c039fc3 100644 --- a/tasks/versioncheck.yml +++ b/tasks/versioncheck.yml @@ -8,37 +8,37 @@ path: '/etc/.ansible-version' state: directory mode: "0755" - when: submodules_versioncheck | bool + when: packages__submodules_versioncheck | bool - name: Check playbook version become: true ansible.builtin.slurp: - src: "/etc/.ansible-version/{{ playbook_version_path }}" + src: "/etc/.ansible-version/{{ packages__playbook_version_path }}" register: playbook_version - when: submodules_versioncheck | bool + when: packages__submodules_versioncheck | bool failed_when: false - name: Print remote role version # noqa: H500 ansible.builtin.debug: msg: "Remote role version: {{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}" - when: submodules_versioncheck | bool + when: packages__submodules_versioncheck | bool - name: Print locale role version # noqa: H500 ansible.builtin.debug: - msg: "Local role version: '{{ playbook_version_number | string }}'." - when: submodules_versioncheck | bool + msg: "Local role version: '{{ packages__playbook_version_number | string }}'." + when: packages__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!" + msg: "Your ansible module has the version '{{ packages__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 >= packages__playbook_version_number|int and packages__submodules_versioncheck | bool - name: Write new version to remote disk become: true ansible.builtin.copy: - content: "{{ playbook_version_number }}" - dest: "/etc/.ansible-version/{{ playbook_version_path }}" + content: "{{ packages__playbook_version_number }}" + dest: "/etc/.ansible-version/{{ packages__playbook_version_path }}" mode: '0644' - when: submodules_versioncheck | bool + when: packages__submodules_versioncheck | bool tags: skip_ansible_lint_template-instead-of-copy diff --git a/vars/main.yml b/vars/main.yml index 3ae22e5..1204cd1 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,6 +1,6 @@ --- # must-have packages for all systems -package__base: +packages__base: - rsync - tmux - sudo @@ -16,7 +16,7 @@ package__base: - lsof - pwgen -package__advanced: +packages__advanced: - tcpdump - sysstat - debian-goodies @@ -31,12 +31,12 @@ package__advanced: - python3-apt - ethstatus -package__python: +packages__python: - python3-pip - python3-dev - python3 -package__cli: +packages__cli: - links - ranger - htop @@ -51,5 +51,5 @@ package__cli: - jq - zstd -playbook_version_number: 8 -playbook_version_path: 'l3d.base.packages.version' +packages__playbook_version_number: 9 +packages__playbook_version_path: 'l3d.base.packages.version'