mirror of
https://github.com/ansible/awx.git
synced 2026-04-09 12:09:20 -02:30
yamllint: Make all files in awx pass yamllint
This commit updates all files that weren't passing yamllint for them to pass. A new yamllint target has been added. One can run `tox -e yamllint` or `yamllint -s .` locally to ensure yaml files are still passing. This check will be enabled in the CI so it can get on every new contributions, and prevent merging non-compliant code. Signed-off-by: Yanis Guenane <yguenane@redhat.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
gather_facts: false
|
||||
connection: local
|
||||
@@ -7,28 +8,28 @@
|
||||
collection_version: 0.0.1 # not for updating, pass in extra_vars
|
||||
|
||||
tasks:
|
||||
- name: Do file content replacements for non-default namespace or package name
|
||||
block:
|
||||
- name: Find all module files
|
||||
find:
|
||||
paths: "{{ playbook_dir }}/plugins/modules"
|
||||
patterns: "*.py"
|
||||
register: module_files
|
||||
- name: Do file content replacements for non-default namespace or package name
|
||||
block:
|
||||
- name: Find all module files
|
||||
find:
|
||||
paths: "{{ playbook_dir }}/plugins/modules"
|
||||
patterns: "*.py"
|
||||
register: module_files
|
||||
|
||||
- name: Change files to support desired namespace and package names
|
||||
replace:
|
||||
path: "{{ item.path }}"
|
||||
regexp: '^extends_documentation_fragment: awx.awx.auth$'
|
||||
replace: 'extends_documentation_fragment: {{ collection_namespace }}.{{ collection_package }}.auth'
|
||||
with_items: "{{ module_files.files }}"
|
||||
- name: Change files to support desired namespace and package names
|
||||
replace:
|
||||
path: "{{ item.path }}"
|
||||
regexp: '^extends_documentation_fragment: awx.awx.auth$'
|
||||
replace: 'extends_documentation_fragment: {{ collection_namespace }}.{{ collection_package }}.auth'
|
||||
with_items: "{{ module_files.files }}"
|
||||
|
||||
- name: Change files to support desired namespace and package names
|
||||
replace:
|
||||
path: "{{ playbook_dir }}/plugins/inventory/tower.py"
|
||||
regexp: "^ NAME = 'awx.awx.tower' # REPLACE$"
|
||||
replace: " NAME = '{{ collection_namespace }}.{{ collection_package }}.tower' # REPLACE"
|
||||
when:
|
||||
- (collection_package != 'awx') or (collection_namespace != 'awx')
|
||||
- name: Change files to support desired namespace and package names
|
||||
replace:
|
||||
path: "{{ playbook_dir }}/plugins/inventory/tower.py"
|
||||
regexp: "^ NAME = 'awx.awx.tower' # REPLACE$"
|
||||
replace: " NAME = '{{ collection_namespace }}.{{ collection_package }}.tower' # REPLACE"
|
||||
when:
|
||||
- (collection_package != 'awx') or (collection_namespace != 'awx')
|
||||
|
||||
- name: Template the galaxy.yml file
|
||||
template: src={{ playbook_dir }}/galaxy.yml.j2 dest={{ playbook_dir }}/galaxy.yml
|
||||
- name: Template the galaxy.yml file
|
||||
template: src={{ playbook_dir }}/galaxy.yml.j2 dest={{ playbook_dir }}/galaxy.yml
|
||||
|
||||
Reference in New Issue
Block a user