added pre-commit configuration for ansible-lint (#93)
Co-authored-by: willtome <wtome@redhat.com>
This commit is contained in:
@@ -1,4 +1,12 @@
|
||||
---
|
||||
profile: production
|
||||
offline: false
|
||||
|
||||
skip_list:
|
||||
- "galaxy[no-changelog]"
|
||||
|
||||
exclude_paths:
|
||||
# would be better to move the roles here to the top-level roles directory
|
||||
- collections/ansible_collections/demo/compliance/roles/
|
||||
- roles/redhatofficial.*
|
||||
- .github/
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
schemaVersion: 2.2.0
|
||||
metadata:
|
||||
name: product-demos
|
||||
|
||||
14
.github/workflows/ansible-lint.yml
vendored
14
.github/workflows/ansible-lint.yml
vendored
@@ -5,21 +5,13 @@ on:
|
||||
- pull_request_target
|
||||
|
||||
env:
|
||||
ANSIBLE_GALAXY_SERVER_LIST: ah,galaxy
|
||||
ANSIBLE_GALAXY_SERVER_AH_URL: https://console.redhat.com/api/automation-hub/
|
||||
ANSIBLE_GALAXY_SERVER_AH_AUTH_URL: https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
|
||||
ANSIBLE_GALAXY_SERVER_AH_TOKEN: ${{ secrets.ANSIBLE_GALAXY_SERVER_AH_TOKEN }}
|
||||
ANSIBLE_GALAXY_SERVER_GALAXY_URL: https://galaxy.ansible.com/
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Ansible Lint
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# Important: This sets up your GITHUB_WORKSPACE environment variable
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0 # needed for progressive mode to work
|
||||
|
||||
# this action implicitly calls actions/checkout
|
||||
- name: Run ansible-lint
|
||||
uses: ansible/ansible-lint-action@v6.11.0
|
||||
uses: ansible/ansible-lint@v6.18.0
|
||||
|
||||
16
.pre-commit-config.yaml
Normal file
16
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.4.0
|
||||
hooks:
|
||||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace
|
||||
- repo: https://github.com/ansible/ansible-lint.git
|
||||
# get latest release tag from https://github.com/ansible/ansible-lint/releases/
|
||||
rev: v6.18.0
|
||||
hooks:
|
||||
- id: ansible-lint
|
||||
additional_dependencies:
|
||||
- jmespath
|
||||
|
||||
...
|
||||
19
.yamllint
Normal file
19
.yamllint
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
extends: default
|
||||
|
||||
rules:
|
||||
line-length: disable
|
||||
trailing-spaces: enable
|
||||
colons:
|
||||
max-spaces-before: 0
|
||||
max-spaces-after: -1
|
||||
indentation:
|
||||
level: error
|
||||
indent-sequences: true # consistent with ansible-lint
|
||||
truthy:
|
||||
level: error
|
||||
allowed-values:
|
||||
- 'true'
|
||||
- 'false'
|
||||
|
||||
...
|
||||
@@ -6,7 +6,8 @@ roles_path=./roles
|
||||
server_list = ah,galaxy
|
||||
|
||||
[galaxy_server.ah]
|
||||
url=https://console.redhat.com/api/automation-hub/
|
||||
#url=https://cloud.redhat.com/api/automation-hub/
|
||||
url=https://console.redhat.com/api/automation-hub/content/published/
|
||||
auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
|
||||
|
||||
[galaxy_server.galaxy]
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
# Set stat_snapshots with model:
|
||||
# [
|
||||
# {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
- name: Create web directory if it does not exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ file_path }}"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
file_path: "{{ web_path | default('/var/www/html/reports') }}"
|
||||
vendor:
|
||||
ios: &my_value 'Cisco'
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
- name: Create HTML report
|
||||
ansible.builtin.template:
|
||||
src: report.j2
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
---
|
||||
file_path: /var/www/html
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
email_from: tower@shadowman.dev
|
||||
to_emails: alex@shadowman.dev,tower@shadowman.dev
|
||||
to_emails_list: "{{ to_emails.split(',') }}"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
- name: Create HTML report
|
||||
ansible.builtin.template:
|
||||
src: report.j2
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
---
|
||||
file_path: /var/www/html
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
- name: Create HTML report
|
||||
ansible.builtin.template:
|
||||
src: report.j2
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
---
|
||||
file_path: /var/www/html/reports
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
email_from: tower@shadowman.dev
|
||||
to_emails: alex@shadowman.dev,tower@shadowman.dev
|
||||
to_emails_list: "{{ to_emails.split(',') }}"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
- name: Create HTML report
|
||||
ansible.builtin.template:
|
||||
src: report.j2
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
---
|
||||
file_path: /var/www/html/reports
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
- name: Create HTML report
|
||||
ansible.windows.win_template:
|
||||
src: report.j2
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
foreman_server_url: "{{ lookup('env', 'SATELLITE_SERVER') }}"
|
||||
foreman_username: "{{ lookup('env', 'SATELLITE_USERNAME') }}"
|
||||
foreman_password: "{{ lookup('env', 'SATELLITE_PASSWORD') }}"
|
||||
|
||||
@@ -5,6 +5,8 @@ collections:
|
||||
- name: redhat_cop.controller_configuration
|
||||
version: 2.3.1
|
||||
# linux
|
||||
- name: ansible.posix
|
||||
version: 1.5.4
|
||||
- name: redhat.insights
|
||||
version: 1.0.7
|
||||
- name: redhat.rhel_system_roles
|
||||
|
||||
@@ -30,4 +30,3 @@
|
||||
- name: Printing to terminal application information
|
||||
ansible.builtin.debug:
|
||||
msg: "The application: {{ application }} has been installed"
|
||||
when: result.changed | bool
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
- name: Configure Red Hat insights
|
||||
ansible.builtin.import_role:
|
||||
name: redhat.insights.insights_client
|
||||
vars:
|
||||
vars: # noqa var-naming[no-role-prefix]
|
||||
insights_display_name: "{{ inventory_hostname }}"
|
||||
insights_tags:
|
||||
env: "{{ env }}"
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
gather_network_resources: all
|
||||
when: ansible_network_os == 'cisco.iosxr.iosxr'
|
||||
|
||||
# The dig lookup requires the python 'dnspython' library
|
||||
# # The dig lookup requires the python 'dnspython' library
|
||||
# - name: Resolve IP address
|
||||
# ansible.builtin.set_fact:
|
||||
# ansible_host: "{{ lookup('community.general.dig', inventory_hostname)}}"
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
gather_facts: false
|
||||
|
||||
tasks:
|
||||
- name: create namespace
|
||||
- name: Create namespace
|
||||
redhat.openshift.k8s:
|
||||
name: eclipse-che
|
||||
api_version: v1
|
||||
kind: Namespace
|
||||
state: present
|
||||
|
||||
- name: create dev spaces subscription
|
||||
- name: Create dev spaces subscription
|
||||
redhat.openshift.k8s:
|
||||
state: present
|
||||
definition:
|
||||
@@ -29,8 +29,8 @@
|
||||
source: redhat-operators
|
||||
sourceNamespace: openshift-marketplace
|
||||
|
||||
- name: wait for dev spaces operator to install
|
||||
k8s_info:
|
||||
- name: Wait for dev spaces operator to install
|
||||
kubernetes.core.k8s_info:
|
||||
api_version: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
name: checlusters.org.eclipse.che
|
||||
@@ -40,7 +40,7 @@
|
||||
delay: 30
|
||||
|
||||
- name: Wait until devspaces-operator is up
|
||||
k8s_info:
|
||||
kubernetes.core.k8s_info:
|
||||
api_version: v1
|
||||
kind: Deployment
|
||||
name: devspaces-operator
|
||||
@@ -50,7 +50,7 @@
|
||||
retries: 10
|
||||
delay: 30
|
||||
|
||||
- name: deploy dev spaces
|
||||
- name: Deploy dev spaces
|
||||
redhat.openshift.k8s:
|
||||
state: present
|
||||
definition:
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
user_message:
|
||||
|
||||
controller_components:
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
- name: Publish CV
|
||||
ansible.builtin.include_role:
|
||||
name: redhat.satellite.content_view_publish
|
||||
vars:
|
||||
vars: # noqa var-naming[no-role-prefix]
|
||||
satellite_content_views:
|
||||
- RHEL7
|
||||
- RHEL8
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
ansible.builtin.include_role:
|
||||
name: "redhat_cop.controller_configuration.{{ item }}"
|
||||
loop: "{{ controller_components }}"
|
||||
vars:
|
||||
vars: # noqa var-naming[no-role-prefix]
|
||||
controller_components:
|
||||
- notification_templates
|
||||
- job_templates
|
||||
|
||||
Reference in New Issue
Block a user