Skip to content

Commit

Permalink
chore: Update ansible-lint and fix low hanging fruit (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
hairmare authored Dec 19, 2024
1 parent 97baf5f commit 6c48db6
Show file tree
Hide file tree
Showing 44 changed files with 147 additions and 127 deletions.
11 changes: 11 additions & 0 deletions .ansible-lint-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This file contains ignores rule violations for ansible-lint

# We should start writing changelogs at some point
galaxy.yml galaxy[no-changelog]

# ansible-lint can't find redhat.rhel_system_roles.network
# we should fix this, maybe by renaming to upstream?
roles/network/tasks/main.yml syntax-check[specific]

# this might take some work to rename
roles/network/defaults/main.yml var-naming[no-role-prefix]
8 changes: 8 additions & 0 deletions .ansible-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
exclude_paths:
- .github/
- venv/
write_list:
- all
warn_list:
- meta-runtime[unsupported-version]
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ on:

jobs:
call-workflow:
uses: radiorabe/actions/.github/workflows/release-ansible-collection.yaml@v0.25.0
uses: radiorabe/actions/.github/workflows/release-ansible-collection.yaml@v0.26.0
secrets:
GALAXY_API_KEY: ${{ secrets.GALAXY_API_KEY }}
2 changes: 1 addition & 1 deletion .github/workflows/semantic-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ on:

jobs:
call-workflow:
uses: radiorabe/actions/.github/workflows/semantic-release.yaml@v0.25.0
uses: radiorabe/actions/.github/workflows/semantic-release.yaml@v0.26.0
secrets:
RABE_ITREAKTION_GITHUB_TOKEN: ${{ secrets.RABE_ITREAKTION_GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ on:

jobs:
call-workflow:
uses: radiorabe/actions/.github/workflows/test-ansible-collection.yaml@v0.25.0
uses: radiorabe/actions/.github/workflows/test-ansible-collection.yaml@v0.26.0
4 changes: 3 additions & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
namespace: radiorabe
name: rabe_foreman
version: 0.0.0
Expand All @@ -9,13 +10,14 @@ license_file: LICENSE
tags:
- radiorabe
- foreman
- infrastructure
dependencies:
ansible.posix: ">=1.3.0"
community.general: ">=3.7.0"
community.postgresql: ">=3.3.0" # for zabbix
community.zabbix: ">=1.9.0"
radiorabe.common: ">=0.2.0"
radiorabe.foreman: ">=0.7.0"
radiorabe.foreman: ">=0.9.0"
radiorabe.podman: ">=0.1.0"
radiorabe.rabe_zabbix: ">=0.1.1"
theforeman.foreman: ">=3.5.0"
Expand Down
3 changes: 2 additions & 1 deletion meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
requires_ansible: ">=2.11,<2.17"
---
requires_ansible: ">=2.14,<2.17"
8 changes: 3 additions & 5 deletions playbooks/content_view_promote.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
---
- name: 'RaBe Foreman Playbooks : Content View Promote'
- name: "RaBe Foreman Playbooks : Content View Promote"
hosts: all
gather_facts: false
collections:
- theforeman.foreman
vars:
rabe_foreman_content_views:
- CentOS 7 Base x86_64
Expand All @@ -17,7 +15,7 @@
- Dev
- Test
tasks:
- name: 'RaBe Foreman Playbook : Content Views : Gather Info'
- name: "RaBe Foreman Playbook : Content Views : Gather Info"
theforeman.foreman.content_view_version_info:
username: "{{ foreman_username | default(omit) }}"
password: "{{ foreman_password | default(omit) }}"
Expand All @@ -39,6 +37,6 @@
content_view: "{{ content_view.content_view }}"
version: "{{ content_view.content_view_versions[0].version }}"
lifecycle_environments: "{{ rabe_foreman_lifecycle_environments }}"
with_items: '{{ content_view_info.results }}'
with_items: "{{ content_view_info.results }}"
loop_control:
loop_var: content_view
8 changes: 3 additions & 5 deletions playbooks/content_view_publish.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
---
- name: 'RaBe Foreman Playbook : Content View Publish'
- name: "RaBe Foreman Playbook : Content View Publish"
hosts: all
gather_facts: false
collections:
- theforeman.foreman
vars:
rabe_foreman_content_views:
- CentOS 7 Base x86_64
Expand All @@ -14,12 +12,12 @@
- CentOS 7 x86_64
- AlmaLinux 9 x86_64
tasks:
- name: 'RaBe Foreman Playbook : Foreman : Content View Publish'
- name: "RaBe Foreman Playbook : Foreman : Content View Publish"
ansible.builtin.include_role:
name: theforeman.foreman.content_view_publish
vars:
foreman_content_views: "{{ rabe_foreman_content_views }}"
- name: 'RaBe Foreman Playbook : Foreman : Content View Publish (Composite)'
- name: "RaBe Foreman Playbook : Foreman : Content View Publish (Composite)"
ansible.builtin.include_role:
name: theforeman.foreman.content_view_publish
vars:
Expand Down
6 changes: 2 additions & 4 deletions playbooks/content_view_version_cleanup.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
---
- name: 'RaBe Foreman Playbook : Content View Version Cleanup'
- name: "RaBe Foreman Playbook : Content View Version Cleanup"
hosts: all
gather_facts: false
collections:
- theforeman.foreman
vars:
rabe_foreman_content_view_version_cleanup_keep: 3
tasks:
- name: 'RaBe Foreman Playbook : Foreman : Content View Version Cleanup'
- name: "RaBe Foreman Playbook : Foreman : Content View Version Cleanup"
ansible.builtin.include_role:
name: theforeman.foreman.content_view_version_cleanup
vars:
Expand Down
3 changes: 2 additions & 1 deletion roles/client/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
galaxy_info:
author: RaBe IT-Reaktion
description: Manage Foreman Clients
issue_tracker_url: https://github.com/radiorabe/ansible-collection-rabe_foreman/issues
license: AGPL-3.0-only
min_ansible_version: '2.9'
min_ansible_version: "2.14"
platforms:
- name: EL
versions:
Expand Down
6 changes: 3 additions & 3 deletions roles/client/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: 'RaBe Foreman Client : Yum : Plugin Config : Disable System Repos'
- name: "RaBe Foreman Client : Yum : Plugin Config : Disable System Repos"
ansible.builtin.lineinfile:
path: /etc/yum/pluginconf.d/subscription-manager.conf
regexp: '^disable_system_repos='
line: 'disable_system_repos=1'
regexp: "^disable_system_repos="
line: "disable_system_repos=1"
3 changes: 2 additions & 1 deletion roles/content/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
galaxy_info:
author: RaBe IT-Reaktion
description: Manage Foreman Content
issue_tracker_url: https://github.com/radiorabe/ansible-collection-rabe_foreman/issues
license: AGPL-3.0-only
min_ansible_version: '2.9'
min_ansible_version: "2.14"
platforms:
- name: EL
versions:
Expand Down
2 changes: 1 addition & 1 deletion roles/content/tasks/activation_keys.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# TODO: figure out how disable repos by default and get rid of overrides here
- name: 'RaBe Foreman Content : Configure Activation Keys'
- name: "RaBe Foreman Content : Configure Activation Keys"
ansible.builtin.include_role:
name: theforeman.foreman.activation_keys
vars:
Expand Down
2 changes: 1 addition & 1 deletion roles/content/tasks/content_views.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: 'RaBe Foreman Content : Configure Content Views'
- name: "RaBe Foreman Content : Configure Content Views"
ansible.builtin.include_role:
name: theforeman.foreman.content_views
vars:
Expand Down
14 changes: 7 additions & 7 deletions roles/content/tasks/lifecycle_environments.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
- name: 'RaBe Foreman Content : Lifecycle Environments'
- name: "RaBe Foreman Content : Lifecycle Environments"
ansible.builtin.include_role:
name: theforeman.foreman.lifecycle_environments
vars:
foreman_lifecycle_environments:
- name: 'Dev'
prior: 'Library'
- name: 'Test'
prior: 'Dev'
- name: 'Prod'
prior: 'Test'
- name: "Dev"
prior: "Library"
- name: "Test"
prior: "Dev"
- name: "Prod"
prior: "Test"
10 changes: 5 additions & 5 deletions roles/content/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
---
- name: 'RaBe Foreman Content : Products'
- name: "RaBe Foreman Content : Products"
ansible.builtin.import_tasks: products.yaml
tags:
- role::rabe_foreman.content
- role::rabe_foreman.content:products
- name: 'RaBe Foreman Content : Sync Plans'
- name: "RaBe Foreman Content : Sync Plans"
ansible.builtin.import_tasks: sync_plans.yaml
tags:
- role::rabe_foreman.content
- role::rabe_foreman.content:sync_plans
- name: 'RaBe Foreman Content : Lifecycle Environments'
- name: "RaBe Foreman Content : Lifecycle Environments"
ansible.builtin.import_tasks: lifecycle_environments.yaml
tags:
- role::rabe_foreman.content
- role::rabe_foreman.content:lifecycle_environments
- name: 'RaBe Foreman Content : Content Views'
- name: "RaBe Foreman Content : Content Views"
ansible.builtin.import_tasks: content_views.yaml
tags:
- role::rabe_foreman.content
- role::rabe_foreman.content:content_views
- name: 'RaBe Foreman Content : Activation Keys'
- name: "RaBe Foreman Content : Activation Keys"
ansible.builtin.import_tasks: activation_keys.yaml
tags:
- role::rabe_foreman.content
Expand Down
7 changes: 3 additions & 4 deletions roles/content/tasks/products.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: 'RaBe Foreman Content : Configure Products'
- name: "RaBe Foreman Content : Configure Products"
ansible.builtin.include_role:
name: theforeman.foreman.repositories
vars:
Expand Down Expand Up @@ -580,7 +580,7 @@
auto_enabled: false
- name: AlmaLinux OS Generic Cloud (Cloud-init) image
label: AlmaLinux_OS_Generic_Cloud_Cloud-init_image
description: >
description: >
The Generic Cloud image is a general purpose virtual machine image
that contains the Cloud-init package. During boot,
cloud-init will take configuration options from cloud metadata and
Expand All @@ -598,8 +598,7 @@
include network configuration, user's SSH key pair installation,
attaching storage devices, etc.
To be used with libvirt, the image has to be altered with
guestfs-tools and
To be used with libvirt, the image has to be altered with guestfs-tools and
virt-customize -a
Downloads/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2 --install
Expand Down
2 changes: 1 addition & 1 deletion roles/content/tasks/sync_plans.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: 'RaBe Foreman Content : Configure Sync Plans'
- name: "RaBe Foreman Content : Configure Sync Plans"
ansible.builtin.include_role:
name: theforeman.foreman.sync_plans
vars:
Expand Down
3 changes: 2 additions & 1 deletion roles/foreman/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
galaxy_info:
author: RaBe IT-Reaktion
description: Manage Foreman Config
issue_tracker_url: https://github.com/radiorabe/ansible-collection-rabe_foreman/issues
license: AGPL-3.0-only
min_ansible_version: '2.9'
min_ansible_version: "2.14"
platforms:
- name: EL
versions:
Expand Down
2 changes: 1 addition & 1 deletion roles/foreman/tasks/global_parameters.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: 'RaBe Foreman Config : Configure Global Parameters'
- name: "RaBe Foreman Config : Configure Global Parameters"
ansible.builtin.include_role:
name: radiorabe.foreman.global_parameters
vars:
Expand Down
13 changes: 6 additions & 7 deletions roles/foreman/tasks/host_groups.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
---
- name: 'RaBe Foreman Config : Configure Host Groups'
- name: "RaBe Foreman Config : Configure Host Groups"
ansible.builtin.include_role:
name: theforeman.foreman.hostgroups
vars:
foreman_hostgroups:
- name: RaBe Core
description: RaBe Core contains roles that set facts and sets settings that don't
rely on anything and are not OS specific.
description: RaBe Core contains roles that set facts and sets settings that don't rely on anything and are not OS specific.
organization: RaBe
location: Randweg
ansible_roles:
Expand Down Expand Up @@ -191,7 +190,7 @@
value: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC4arUJdueCQnOkjVOvrruEEs9M/lKw2ITorTTEIIFgcNAGZNs+SFFxugtMWY2jzrcHoxwSZel3eAMjvS76by6z3ZqZUvMxVHACR0FZvP2WtLk2BjgDjYdmBGDpMArvncHkaiVtjEaruwXVqO+64qsrYXQ3qhUiah+9soFHghWZWS3i+Dnd1JiNFX6TZP+ooqshBaClspAfcywsqFhsFNeU50rlsl11T13vLmZ/G140VF7uhaZ2ukOEj3HSSBcQ1DKIyanoo4fpAG8ealo6Nur0t5rlO67ACgRjLIVBS0LnVG5tvXtnKbz6A0uoUHC5aesDnDUskImWiKnz/6r2QenMkzD08BT6VlaFHhpp4ve2/d2lmjAl4EXvNOCwGsGV9A5BB1O130dwRk85Cxutxm94tuThElWlu37BB8pxOYz8qD+Vph5TVbC4mi1/30hUQffll0x/mcplJsFLY9H7eX0S+Ki2W++udWQ4HfwxbxXlJltMLEw7fhSxEQdGNfIaoM0= [email protected]
- name: network_connections
parameter_type: yaml
value:
value:
- name: Bond bond0
state: up
- name: dmz
Expand All @@ -204,7 +203,7 @@
interface_name: bond0.133
type: vlan
vlan:
id: '133'
id: "133"
parent: Bond bond0
controller: dmz
port_type: bridge
Expand All @@ -216,7 +215,7 @@
domain: dmz.int.rabe.ch
subnet: dmz
compute_resource: server-008.dmz-admin.int.rabe.ch
compute_profile: 1-Small
compute_profile: "1-Small"
- name: AlmaLinux 9 DMZ server-009 VMs
description: AlmaLinux 9 virtual machines to be run on server-009
parent: RaBe Core/RaBe Base/EL9/AlmaLinux 9
Expand All @@ -225,4 +224,4 @@
domain: dmz.int.rabe.ch
subnet: dmz
compute_resource: server-009.dmz-admin.int.rabe.ch
compute_profile: 1-Small
compute_profile: "1-Small"
18 changes: 9 additions & 9 deletions roles/foreman/tasks/job_templates.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
- name: 'RaBe Foreman Config : Job Templates'
- name: "RaBe Foreman Config : Job Templates"
block:
- name: 'RaBe Foreman Config : Unlock All Job Templates'
- name: "RaBe Foreman Config : Unlock All Job Templates"
ansible.builtin.include_role:
name: radiorabe.foreman.job_templates
vars:
foreman_job_templates:
- name: '*'
- name: "*"
locked: false
when: not ansible_check_mode
- name: 'RaBe Foreman Config : Configure Job Templates'
- name: "RaBe Foreman Config : Configure Job Templates"
ansible.builtin.include_role:
name: radiorabe.foreman.job_templates
vars:
Expand Down Expand Up @@ -44,7 +44,7 @@
provider_type: Ansible
kind: job_template
model: JobTemplate
file_name: '{{ role_path }}/../../../rabe_foreman/roles/foreman/files/job_templates/rabe_foreman_publish_content_view.erb'
file_name: "{{ role_path }}/../../../rabe_foreman/roles/foreman/files/job_templates/rabe_foreman_publish_content_view.erb"
- name: RaBe Foreman - Promote Content Views to Prod
state: present
job_category: RaBe Foreman
Expand All @@ -61,7 +61,7 @@
provider_type: Ansible
kind: job_template
model: JobTemplate
file_name: '{{ role_path }}/../../../rabe_foreman/roles/foreman/files/job_templates/rabe_foreman_promote_content_views.erb'
file_name: "{{ role_path }}/../../../rabe_foreman/roles/foreman/files/job_templates/rabe_foreman_promote_content_views.erb"
- name: RaBe Foreman - Version Cleanup Content Views
state: present
job_category: RaBe Foreman
Expand All @@ -70,14 +70,14 @@
provider_type: Ansible
kind: job_template
model: JobTemplate
file_name: '{{ role_path }}/../../../rabe_foreman/roles/foreman/files/job_templates/rabe_foreman_version_cleanup_content_view.erb'
file_name: "{{ role_path }}/../../../rabe_foreman/roles/foreman/files/job_templates/rabe_foreman_version_cleanup_content_view.erb"
when: not ansible_check_mode
always:
- name: 'RaBe Foreman Config : Lock All Job Templates'
- name: "RaBe Foreman Config : Lock All Job Templates"
ansible.builtin.include_role:
name: radiorabe.foreman.job_templates
vars:
foreman_job_templates:
- name: '*'
- name: "*"
locked: true
when: not ansible_check_mode
Loading

0 comments on commit 6c48db6

Please sign in to comment.