1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_packages.git synced 2024-08-16 10:19:51 +02:00

Improve linting

This commit is contained in:
L3D 2024-04-27 02:49:52 +02:00
parent d80ba95f4c
commit 3635fbf72c
No known key found for this signature in database
GPG key ID: AD65B920933B4B20
5 changed files with 20 additions and 20 deletions

View file

@ -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_security`` | ``true`` | Inofficial Debian Security Mirror |
| ``packages__ethz_updates`` | ``true`` | Updates Mirror | | ``packages__ethz_updates`` | ``true`` | Updates Mirror |
| ``packages__ethz__backports`` | ``true`` | Backports 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 Contributing
------------- -------------

View file

@ -20,4 +20,4 @@ packages__install_cli: false
packages__install_extra_packages: [] packages__install_extra_packages: []
# Optional perform simple Versionscheck # Optional perform simple Versionscheck
submodules_versioncheck: false packages__submodules_versioncheck: false

View file

@ -6,7 +6,7 @@
- name: Run simple versionscheck (optional) - name: Run simple versionscheck (optional)
ansible.builtin.include_tasks: ansible.builtin.include_tasks:
file: 'versioncheck.yml' file: 'versioncheck.yml'
when: submodules_versioncheck | bool when: packages__submodules_versioncheck | bool
- name: Adding additional apt sources (optional) - name: Adding additional apt sources (optional)
ansible.builtin.include_tasks: ansible.builtin.include_tasks:

View file

@ -8,37 +8,37 @@
path: '/etc/.ansible-version' path: '/etc/.ansible-version'
state: directory state: directory
mode: "0755" mode: "0755"
when: submodules_versioncheck | bool when: packages__submodules_versioncheck | bool
- name: Check playbook version - name: Check playbook version
become: true become: true
ansible.builtin.slurp: ansible.builtin.slurp:
src: "/etc/.ansible-version/{{ playbook_version_path }}" src: "/etc/.ansible-version/{{ packages__playbook_version_path }}"
register: playbook_version register: playbook_version
when: submodules_versioncheck | bool when: packages__submodules_versioncheck | bool
failed_when: false failed_when: false
- name: Print remote role version # noqa: H500 - name: Print remote role version # noqa: H500
ansible.builtin.debug: ansible.builtin.debug:
msg: "Remote role version: {{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}" 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 - name: Print locale role version # noqa: H500
ansible.builtin.debug: ansible.builtin.debug:
msg: "Local role version: '{{ playbook_version_number | string }}'." msg: "Local role version: '{{ packages__playbook_version_number | string }}'."
when: submodules_versioncheck | bool when: packages__submodules_versioncheck | bool
- name: Check if your version is outdated - name: Check if your version is outdated
ansible.builtin.fail: 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: 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 - name: Write new version to remote disk
become: true become: true
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ playbook_version_number }}" content: "{{ packages__playbook_version_number }}"
dest: "/etc/.ansible-version/{{ playbook_version_path }}" dest: "/etc/.ansible-version/{{ packages__playbook_version_path }}"
mode: '0644' mode: '0644'
when: submodules_versioncheck | bool when: packages__submodules_versioncheck | bool
tags: skip_ansible_lint_template-instead-of-copy tags: skip_ansible_lint_template-instead-of-copy

View file

@ -1,6 +1,6 @@
--- ---
# must-have packages for all systems # must-have packages for all systems
package__base: packages__base:
- rsync - rsync
- tmux - tmux
- sudo - sudo
@ -16,7 +16,7 @@ package__base:
- lsof - lsof
- pwgen - pwgen
package__advanced: packages__advanced:
- tcpdump - tcpdump
- sysstat - sysstat
- debian-goodies - debian-goodies
@ -31,12 +31,12 @@ package__advanced:
- python3-apt - python3-apt
- ethstatus - ethstatus
package__python: packages__python:
- python3-pip - python3-pip
- python3-dev - python3-dev
- python3 - python3
package__cli: packages__cli:
- links - links
- ranger - ranger
- htop - htop
@ -51,5 +51,5 @@ package__cli:
- jq - jq
- zstd - zstd
playbook_version_number: 8 packages__playbook_version_number: 9
playbook_version_path: 'l3d.base.packages.version' packages__playbook_version_path: 'l3d.base.packages.version'