Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align linting configurations with other repos #371

Merged
merged 1 commit into from
Oct 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ use_default_rules: true
# with verbosity set to 1, its dumping 'unknown file type messages'
# verbosity: 1
skip_list: []
# With the move of the .yamllint.yml to TLD ansible-lint now picks up our config so no need to exclude it.
# YAML: Ansible lint doing yaml checks that we were already doing but without config.
# - yaml
kinds:
- playbooks: "**/examples/templates/*.{yml,yaml}"
- playbooks: "**/examples/*.{yml,yaml}"
- playbooks: "**/examples/automatetheautomation/*.{yml,yaml}"
- tasks: "**/examples/tasks/*.yml"
- vars: "**/examples/automatetheautomation/orgs_vars/**/*.yml"
- vars: "**/examples/configs/*.yml"
- vars: "**/examples/configs_export_model/*.yml"
- vars: "**/examples/vars/*.yml"
- vars: "**/roles/**/tests/configs/*.yml"
...
3 changes: 3 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ repos:
entry: "ansible-lint"
args:
- "--profile=production"
additional_dependencies:
- "ansible-core>=2.13"
- "yamllint>=1.26,<2.0"
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.5.1
hooks:
Expand Down
11 changes: 5 additions & 6 deletions .yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ rules:
document-end: {present: true}
indentation:
level: error
indent-sequences: consistent
# Require indentation https://redhat-cop.github.io/automation-good-practices/#_yaml_and_jinja2_syntax
indent-sequences: true
truthy:
level: error
# Allow only YAML 1.2 booleans https://redhat-cop.github.io/automation-good-practices/#_yaml_and_jinja2_syntax
allowed-values:
- 'True'
- 'False'
- 'true'
- 'false'
- 'on'
- 'true'
- 'false'
...
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ controller_credential_types:
- host
injectors:
env:
CLOUDFORMS_URL: !unsafe '{{ host }}'
CLOUDFORMS_USERNAME: !unsafe '{{ username }}'
CLOUDFORMS_PASSWORD: !unsafe '{{ password }}'
CLOUDFORMS_URL: !unsafe '{{ host }}'
CLOUDFORMS_USERNAME: !unsafe '{{ username }}'
CLOUDFORMS_PASSWORD: !unsafe '{{ password }}'
CLOUDFORMS_SSL_VERIFY: !unsafe '{{ ssl_verify }}'
...
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ controller_templates:
execution_environment: "Default execution environment"
instance_groups:
- Container_Groups_Instance
survey_enabled: True
survey_enabled: true
survey_spec:
name: 'TEST'
description: 'Test'
Expand Down
136 changes: 68 additions & 68 deletions examples/configs_export_model/projects_export.yml
Original file line number Diff line number Diff line change
@@ -1,80 +1,80 @@
---
controller_projects:
- name: Tower Config Testing
description: ''
local_path: _48__controller_config_testing
scm_type: git
scm_url: https://github.com/ansible/tower-example.git
scm_branch: master
scm_refspec: ''
scm_clean: false
scm_delete_on_update: false
timeout: 0
scm_update_on_launch: false
scm_update_cache_timeout: 0
allow_override: false
credential:
credential_type:
kind: scm
name: Source Control
type: credential_type
name: AWX-Collection-tests-controller_workflow_job_template-scm-cred
organization:
name: Default
type: organization
type: credential
custom_virtualenv:
organization:
name: Satellite
type: organization
related:
schedules: []
notification_templates_started: []
notification_templates_success: []
notification_templates_error:
- organization:
name: Satellite
- name: Tower Config Testing
description: ''
local_path: _48__controller_config_testing
scm_type: git
scm_url: https://github.com/ansible/tower-example.git
scm_branch: master
scm_refspec: ''
scm_clean: false
scm_delete_on_update: false
timeout: 0
scm_update_on_launch: false
scm_update_cache_timeout: 0
allow_override: false
credential:
credential_type:
kind: scm
name: Source Control
type: credential_type
name: AWX-Collection-tests-controller_workflow_job_template-scm-cred
organization:
name: Default
type: organization
name: irc-satqe-chat-notification
type: notification_template
natural_key:
type: credential
custom_virtualenv:
organization:
name: Satellite
type: organization
name: Tower Config Testing
type: project
- name: Tower Config
description: ''
local_path: _52__controller_config
scm_type: git
scm_url: https://github.com/ansible/tower-example.git
scm_branch: master
scm_refspec: ''
scm_clean: false
scm_delete_on_update: false
timeout: 0
wait: true
scm_update_on_launch: false
scm_update_cache_timeout: 0
allow_override: false
custom_virtualenv:
organization:
name: Satellite
type: organization
related:
schedules: []
notification_templates_started: []
notification_templates_success: []
notification_templates_error:
- organization:
related:
schedules: []
notification_templates_started: []
notification_templates_success: []
notification_templates_error:
- organization:
name: Satellite
type: organization
name: irc-satqe-chat-notification
type: notification_template
natural_key:
organization:
name: Satellite
type: organization
name: irc-satqe-chat-notification
type: notification_template
natural_key:
name: Tower Config Testing
type: project
- name: Tower Config
description: ''
local_path: _52__controller_config
scm_type: git
scm_url: https://github.com/ansible/tower-example.git
scm_branch: master
scm_refspec: ''
scm_clean: false
scm_delete_on_update: false
timeout: 0
wait: true
scm_update_on_launch: false
scm_update_cache_timeout: 0
allow_override: false
custom_virtualenv:
organization:
name: Satellite
type: organization
name: Tower Config
type: project
related:
schedules: []
notification_templates_started: []
notification_templates_success: []
notification_templates_error:
- organization:
name: Satellite
type: organization
name: irc-satqe-chat-notification
type: notification_template
natural_key:
organization:
name: Satellite
type: organization
name: Tower Config
type: project
...
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
controller_credential_input_sources:
- source_credential: cyberark
target_credential: gitlab
input_field_name: password
metadata:
object_query: Safe=MY_SAFE;Object=AWX-user
object_query_format: Exact
description: Fill the gitlab credential from CyberArk
- source_credential: cyberark
target_credential: gitlab
input_field_name: password
metadata:
object_query: Safe=MY_SAFE;Object=AWX-user
object_query_format: Exact
description: Fill the gitlab credential from CyberArk
...
44 changes: 22 additions & 22 deletions roles/credential_types/tests/configs/credential_types.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
---
controller_credential_types:
- name: REST API Credential
description: REST API Credential
kind: cloud
inputs:
fields:
- type: string
id: rest_username
label: REST Username
- secret: true
type: string
id: rest_password
label: REST Password
required:
- rest_username
- rest_password
injectors:
extra_vars:
rest_password: "{ { rest_password }}"
rest_username: "{ { rest_username }}"
env:
rest_username_env: "{ { rest_username }}"
rest_password_env: "{ { rest_password }}"
- name: REST API Credential
description: REST API Credential
kind: cloud
inputs:
fields:
- type: string
id: rest_username
label: REST Username
- secret: true
type: string
id: rest_password
label: REST Password
required:
- rest_username
- rest_password
injectors:
extra_vars:
rest_password: "{ { rest_password }}"
rest_username: "{ { rest_username }}"
env:
rest_username_env: "{ { rest_username }}"
rest_password_env: "{ { rest_password }}"
...
14 changes: 7 additions & 7 deletions roles/credentials/tests/configs/credentials.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
controller_credentials:
- name: gitlab
description: Credentials for GitLab
organization: Default
credential_type: Source Control
inputs:
username: person
password: password
- name: gitlab
description: Credentials for GitLab
organization: Default
credential_type: Source Control
inputs:
username: person
password: password
...
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
controller_execution_environments:
- name: Tower env
organization: Default
image: quay.io/ansible/awx-ee
pull: always
- name: Tower env
organization: Default
image: quay.io/ansible/awx-ee
pull: always
...
8 changes: 4 additions & 4 deletions roles/groups/tests/configs/group.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
controller_groups:
- name: localhost
inventory: My Inv
variables:
my_var: true
- name: localhost
inventory: My Inv
variables:
my_var: true
...
8 changes: 4 additions & 4 deletions roles/hosts/tests/configs/host.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
controller_host:
- name: localhost
inventory: My Inv
variables:
my_var: true
- name: localhost
inventory: My Inv
variables:
my_var: true
...
24 changes: 12 additions & 12 deletions roles/notification_templates/tests/configs/notifications.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
controller_notification_templates:
- name: Email notification
description: Send out emails for Controller jobs
organization: Default
notification_type: email
notification_configuration:
host: smtp.example.com
recipients:
- [email protected]
sender: [email protected]
port: '25'
username: ''
password: ''
- name: Email notification
description: Send out emails for Controller jobs
organization: Default
notification_type: email
notification_configuration:
host: smtp.example.com
recipients:
- [email protected]
sender: [email protected]
port: '25'
username: ''
password: ''
...
2 changes: 1 addition & 1 deletion roles/object_diff/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ controller_hostname: "{{ vault_controller_hostname | default(lookup('env', 'CONT
controller_validate_certs: "{{ vault_controller_validate_certs | default(lookup('env', 'CONTROLLER_VERIFY_SSL')) }}"

# populate_controller_api_user_accounts_without_external_accounts
drop_user_external_accounts: True
drop_user_external_accounts: true

# Automation Controller Object Lists
controller_settings: []
Expand Down
3 changes: 2 additions & 1 deletion roles/object_diff/tests/drop_diff.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
- hosts: localhost
- name: Test playbook
hosts: localhost
connection: local
gather_facts: false
roles:
Expand Down
3 changes: 2 additions & 1 deletion roles/object_diff/tests/object_diff.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
- hosts: localhost
- name: Object diff playbook
hosts: localhost
connection: local
gather_facts: false
roles:
Expand Down
4 changes: 2 additions & 2 deletions roles/organizations/tests/configs/organizations.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
controller_organizations:
- name: Default
description: Default
- name: Default
description: Default
...
Loading