Commit df24bba
committed
ansible-lint: comprehensive linting and manual fixes
This commit addresses systematic ansible-lint violations across the entire
kdevops playbook infrastructure using both automated tools and manual fixes.
Manual fixes performed:
1. Fixed ansible-lint --fix corruption
- Resolved DuplicateKeyError in linux-mirror/tasks/main.yml where duplicate
failed_when keys were incorrectly added by automated fixing
- Corrected malformed YAML patterns in devconfig/tasks/main.yml where
ansible-lint --fix corrupted variable syntax (path: "{{" -> path: "{{ var }}")
2. Systematic rule violation fixes
- no-changed-when: Added changed_when: false to information-gathering
commands (git status, systemctl is-active, uname, etc.) that don't modify
system state
- ignore-errors: Replaced ignore_errors: true with appropriate failed_when
conditions for connectivity checks and optional operations
- name[missing]: Added descriptive names to all unnamed tasks across
200+ playbook files, including distribution-specific setup tasks and
package management role inclusions
- yaml[truthy]: Standardized boolean values to use true/false instead
of yes/no for consistency
3. Enhanced error handling
- Replaced blanket ignore_errors with specific failed_when conditions for:
- Network connectivity checks (failed_when: false)
- Firewall status checks (failed_when: firewalld_status.rc not in [0, 3, 4])
- APT mirror connectivity checks
- Optional git operations and file checks
4. Improved task clarity
- Added meaningful task names following "action + target" pattern
- Improved debugging capability by making all operations clearly identifiable
- Enhanced maintainability for future development
- Added proper spacing between tasks for better readability
5. Automated tooling created
- Scripts for systematic fixing of common patterns
- Validation tools to ensure consistency across roles
- Pattern matching for bulk updates while preserving manual customizations
6. Additional missing task names fixed
- Fixed 20 additional install-deps/main.yml files with missing task names
- Added consistent naming for distribution-specific setup tasks:
- "Include package management role" for ansible.builtin.include_role
- "Debian/Ubuntu distribution specific setup" for debian import_tasks
- "SUSE distribution specific setup" for suse import_tasks
- "RedHat distribution specific setup" for redhat import_tasks
- "Fedora distribution specific setup" for fedora import_tasks
- Ensured proper blank line spacing between consecutive tasks
The result is a more maintainable, debuggable, and reliable automation
infrastructure that follows Ansible best practices while preserving all
existing functionality.
Generated-by: Claude AI
Signed-off-by: Daniel Gomez <[email protected]>1 parent a0183ab commit df24bba
File tree
234 files changed
+5308
-5098
lines changed- playbooks
- roles
- ansible_cfg/tasks
- blktests
- defaults
- handlers
- tasks
- install-deps
- debian
- redhat
- suse
- bootlinux
- defaults
- tasks
- build
- install-deps
- debian
- redhat
- suse
- install-minimal-deps
- debian
- redhat
- suse
- install
- update-grub
- btrfs_progs
- defaults
- tasks
- install-deps
- debian
- redhat
- suse
- build_qemu
- defaults
- tasks
- install-deps
- debian
- fedora
- redhat
- suse
- common
- defaults
- tasks
- compile_dbench
- defaults
- tasks
- install-deps
- debian
- create_data_partition/tasks
- create_nfs_mount/tasks
- create_partition/tasks
- install-deps
- debian
- redhat
- suse
- create_tmpfs/tasks
- cxl
- defaults
- tasks
- cxl-create-dc-region
- cxl-dcd-setup
- cxl-mem-setup
- install-deps
- debian
- redhat
- suse
- devconfig
- defaults
- tasks
- config-custom-repos-and-packages
- redhat
- install-deps
- debian
- redhat
- suse
- kotd-rev-kernel
- debian
- redhat
- suse
- fstests_prep_localhost
- defaults
- tasks
- install-deps
- debian
- redhat
- suse
- fstests
- defaults
- handlers
- tasks
- install-deps
- debian
- redhat
- suse
- gen_hosts
- defaults
- tasks
- gen_nodes
- defaults
- tasks
- gen_pci_kconfig
- defaults
- tasks
- gen_tfvars
- defaults
- tasks
- gitr
- defaults
- tasks
- install-deps
- debian
- redhat
- suse
- guestfs
- defaults
- tasks/bringup
- hypervisor-tuning
- defaults
- tasks
- install_systemd_journal_remote
- defaults
- tasks
- install-deps
- debian
- redhat
- suse
- install_systemd_timesyncd
- defaults
- tasks
- install-deps
- debian
- redhat
- suse
- install_terraform
- defaults
- tasks
- install-deps
- debian
- redhat
- suse
- iscsi/tasks
- kdc
- tasks
- install-deps
- debian
- redhat
- suse
- vars
- kdevops_archive
- defaults
- tasks
- krb5/tasks
- install-deps
- debian
- redhat
- suse
- ktls/tasks
- install-deps
- debian
- redhat
- suse
- libvirt_pcie_passthrough
- defaults
- tasks
- libvirt_storage_pool_create
- defaults
- tasks
- libvirt_user
- defaults
- tasks
- enable-user
- debian
- redhat
- suse
- install-deps
- debian
- fedora
- redhat
- suse
- linux-mirror
- defaults
- tasks
- install-deps/fedora
- ltp
- defaults
- tasks
- mmtests
- defaults
- tasks
- install-deps
- debian
- redhat
- suse
- nfsd_add_export/tasks
- storage
- nfsd/tasks
- install-deps
- debian
- redhat
- suse
- nfstest
- defaults
- tasks
- pkg/tasks
- postfix_relay_host
- defaults
- tasks
- pynfs
- defaults
- tasks
- install-deps
- debian
- redhat
- suse
- reboot-limit
- defaults
- tasks
- selftests
- defaults
- tasks
- install-deps
- debian
- redhat
- suse
- siw/tasks
- smbd/tasks
- install-deps
- debian
- redhat
- suse
- steady_state
- defaults
- tasks
- sysbench
- defaults
- tasks
- install-deps
- debian
- redhat
- suse
- mysql-docker
- postgresql-native
- update_etc_hosts
- defaults
- tasks
- update_ssh_config_guestfs/tasks
- volume_group/tasks
- terraform
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
234 files changed
+5308
-5098
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
Lines changed: 13 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
| 68 | + | |
| 69 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | | - | |
7 | | - | |
| 7 | + | |
| 8 | + | |
8 | 9 | | |
9 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
12 | 17 | | |
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
0 commit comments