Skip to content

Commit

Permalink
fix(ansible-lint): satisfy ansible-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Daenou committed Dec 28, 2023
1 parent 6a8264b commit c351e77
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 26 deletions.
6 changes: 6 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ skip_list:
- name[template]
# When we use command, we do so because the corresponding module is insufficient
- command-instead-of-module
# ansible-lint doesn't like us using vars. as a prefix for templating variables and wants us to prefix the rolename for variables. But we're using global variables not specific to a role
- var-naming
# The commits are the changelog
- galaxy[no-changelog]
# We're not 1.0.0 yet and that's ok
- galaxy[version-incorrect]
37 changes: 20 additions & 17 deletions .github/workflows/galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
---

Check failure on line 1 in .github/workflows/galaxy.yml

View workflow job for this annotation

GitHub Actions / build

load-failure[runtimeerror]

Failed to load YAML file: .github/workflows/galaxy.yml

Check failure on line 1 in .github/workflows/galaxy.yml

View workflow job for this annotation

GitHub Actions / build

load-failure[runtimeerror]

Failed to load YAML file: .github/workflows/galaxy.yml

name: Ansible Galaxy
tags:
- linux
- infrastructure

on:
push:
tags:
- 'v*'
on:
push:
tags:
- 'v*'

jobs:
deploy:
runs-on: ubuntu-latest
steps:
jobs:
deploy:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Set version in galaxy.yml
run: |
VERSION=${GITHUB_REF#refs/tags/v}
sed -re "s/^version:.*$/version: ${VERSION}/" -i galaxy.yml
- name: Set version in galaxy.yml
run: |
VERSION=${GITHUB_REF#refs/tags/v}
sed -re "s/^version:.*$/version: ${VERSION}/" -i galaxy.yml
- name: Upload collection to Ansible Galaxy
uses: ansible/[email protected]
with:
api_key: ${{ secrets.GALAXY_API_KEY }}
- name: Upload collection to Ansible Galaxy
uses: ansible/[email protected]
with:
api_key: ${{ secrets.GALAXY_API_KEY }}
5 changes: 4 additions & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
### REQUIRED
# The namespace of the collection. This can be a company/brand/organization or product namespace under which all
# content lives. May only contain alphanumeric lowercase characters and underscores. Namespaces cannot start with
Expand Down Expand Up @@ -29,7 +30,9 @@ license:

# A list of tags you want to associate with the collection for indexing/searching. A tag name has the same character
# requirements as 'namespace' and 'name'
tags: []
tags:
- linux
- infrastructure

# Collections that this collection requires to be installed for it to be usable. The key of the dict is the
# collection label 'namespace.name'. The value is a version range
Expand Down
2 changes: 1 addition & 1 deletion meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---

requires_ansible: ">=2.10"
requires_ansible: ">=2.12"
1 change: 0 additions & 1 deletion roles/maintenance_10_linux/vars/RedHat.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---

linux_allowed_login_since: -90days

10 changes: 5 additions & 5 deletions roles/maintenance_12_ubuntu/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
taskid: ignore-me
name: bar

#(12-010) Update package lists and check for errors `apt update`
# (12-010) Update package lists and check for errors `apt update`
- <<: *task
vars:
taskid: 12-010
Expand All @@ -22,7 +22,7 @@
changed_when: no


#(12-012) dkpg status: Are there packages which do not have the dpkg status ii or hi? `dpkg -l | grep -vE '^[hi]i'` Packages with status rc or similar can be removed completely with `dpkg -P`, be careful, usually the configuration files are removed.
# (12-012) dkpg status: Are there packages which do not have the dpkg status ii or hi? `dpkg -l | grep -vE '^[hi]i'` Packages with status rc or similar can be removed completely with `dpkg -P`, be careful, usually the configuration files are removed.
- <<: *task
vars:
taskid: 12-012
Expand All @@ -42,7 +42,7 @@
changed_when: "ubuntu_dpkg_status.stdout_lines | length > 0"


#(12-017) apt: Simulate the package upgrade `apt --simulate upgrade`.
# (12-017) apt: Simulate the package upgrade `apt --simulate upgrade`.
- <<: *task
vars:
taskid: 12-017
Expand All @@ -53,7 +53,7 @@
check_mode: yes


#(12-019) apt: Remove obsolete packages `apt autoremove`.
# (12-019) apt: Remove obsolete packages `apt autoremove`.
- <<: *task
vars:
taskid: 12-019
Expand All @@ -62,7 +62,7 @@
autoremove: yes
check_mode: yes

#(12-020) boot-config: Check boot configuration: Check ramdisk for actuality `update-initramfs -u` and keep bootloader up to date with `update-grub`.
# (12-020) boot-config: Check boot configuration: Check ramdisk for actuality `update-initramfs -u` and keep bootloader up to date with `update-grub`.
- <<: *task
vars:
taskid: 12-020
Expand Down
2 changes: 1 addition & 1 deletion roles/maintenance_15_rhel/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
taskid: 15-011
name: "Does yum check-update work | Show exit status"
ansible.builtin.debug:
msg: "Exited with: {{ yum_checkupdate_output.rc }}, Error is: {{ yum_checkupdate_output.stderr_lines|default('Not available') }}"
msg: "Exited with: {{ yum_checkupdate_output.rc }}, Error is: {{ yum_checkupdate_output.stderr_lines | default('Not available') }}"
changed_when: "yum_checkupdate_output.rc not in [0, 100]"

- <<: *task
Expand Down

0 comments on commit c351e77

Please sign in to comment.