Skip to content

Commit 1d3cdef

Browse files
committed
testing: lint and docs improvements
This commit resolves the following lint rules: - 'yaml' - 'yaml[truthy]' - 'risky-file-permissions' - 'no-changed-when' It moves 'yaml' to 'yaml[indentation]' and 'yaml[line-length]' to avoid skipping rules that are needed. Adds an exclusion folder for the .github folder due to ansible/ansible-lint#3645 Updates the toolbox repo 'generate_ansible_default_settings' option to enforce the linting of the parameters and constants.
1 parent 666961b commit 1d3cdef

File tree

137 files changed

+315
-314
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+315
-314
lines changed

config/ansible-lint.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
exclude_paths:
2+
- .github
3+
14
skip_list:
25
# Hide "wrong indentation: expected 4 but found 2 (indentation)"
36
# until we find out how to properly configure it
4-
- 'yaml'
7+
- 'yaml[indentation]'
8+
- 'yaml[line-length]'
59
# Do not force galaxy info in meta/main.yml
610
- 'meta-no-info'
711
# Hide "Commands should not change things if nothing needs doing"
@@ -16,8 +20,5 @@ skip_list:
1620
- 'deprecated-local-action'
1721
- 'no-free-form'
1822
- 'chema[meta]'
19-
- 'yaml[truthy]'
20-
- 'risky-file-permissions'
2123
- 'ignore-errors'
22-
- 'no-changed-when'
2324
- 'fqcn'

roles/benchmarking/benchmarking_deploy_coco_dataset/defaults/main/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# Auto-generated file, do not edit manually ...
1+
# Auto-generated file, do not edit manually ...
22
# Toolbox generate command: repo generate_ansible_default_settings
33
# Source component: Benchmarking.download_coco_dataset
44

5+
# Parameters
56
# Hostname of the node where the download pod will be executed.
67
# Mandatory value
78
benchmarking_deploy_coco_dataset_node_hostname:
@@ -17,4 +18,3 @@ benchmarking_deploy_coco_dataset_storage_dir: /storage
1718

1819
# Path to credentials to use for accessing the dataset s3 bucket.
1920
benchmarking_deploy_coco_dataset_s3_cred:
20-

roles/benchmarking/benchmarking_deploy_coco_dataset/tasks/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
template:
3737
src: "{{ coco_dataset_pvc }}"
3838
dest: "{{ artifact_extra_logs_dir }}/001_pvc_coco-dataset.yml"
39-
mode: 0400
39+
mode: '0400'
4040

4141
- name: Check if the PVC already exists
4242
command: oc get -f "{{ artifact_extra_logs_dir }}/001_pvc_coco-dataset.yml" -oname
@@ -52,7 +52,7 @@
5252
template:
5353
src: "{{ coco_dataset_pod }}"
5454
dest: "{{ artifact_extra_logs_dir }}/002_pod_coco-dataset.yml"
55-
mode: 0400
55+
mode: '0400'
5656

5757
- name: Delete the Pod, if it exists
5858
command:

roles/benchmarking/benchmarking_run_mlperf_ssd/defaults/main/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# Auto-generated file, do not edit manually ...
1+
# Auto-generated file, do not edit manually ...
22
# Toolbox generate command: repo generate_ansible_default_settings
33
# Source component: Benchmarking.run_mlperf_ssd
44

5+
# Parameters
56
# Hostname of the node where the ssd benchmark will be executed.
67
# Mandatory value
78
benchmarking_run_mlperf_ssd_node_hostname:
@@ -19,4 +20,3 @@ benchmarking_run_mlperf_ssd_epochs:
1920
# Benchmark threshold target value.
2021
# Type: Float
2122
benchmarking_run_mlperf_ssd_threshold:
22-

roles/benchmarking/benchmarking_run_mlperf_ssd/defaults/main/preset.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ benchmarking_run_mlperf_ssd_dataset_pvc_name: "benchmarking-coco-dataset"
55
benchmarking_run_mlperf_ssd_entrypoint_cm_name: "benchmarking-mlperf-ssd-entrypoint"
66

77
# name of the pod running the SSD benchmark
8-
benchmarking_run_mlperf_ssd_name: "benchmarking-mlperf-ssd"
8+
benchmarking_run_mlperf_ssd_name: "benchmarking-mlperf-ssd"

roles/benchmarking/benchmarking_run_mlperf_ssd/tasks/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
template:
3535
src: "{{ benchmarking_mlperf_ssd_pod }}"
3636
dest: "{{ artifact_extra_logs_dir }}/001_pod_run-mlperf-ssd.yml"
37-
mode: 0400
37+
mode: '0400'
3838

3939
- name: Delete the Pod, if it exists
4040
command:
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# Auto-generated file, do not edit manually ...
1+
# Auto-generated file, do not edit manually ...
22
# Toolbox generate command: repo generate_ansible_default_settings
33
# Source component: Cluster.capture_environment
4-

roles/cluster/cluster_capture_environment/tasks/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
copy:
4343
content: "{{ git_version.stdout }}"
4444
dest: "{{ artifact_extra_logs_dir }}/ci_artifact.git_version"
45-
mode: 0644
45+
mode: '0644'
4646

4747
- name: Fetch ci-artifact last git commit
4848
command:
@@ -53,7 +53,7 @@
5353
copy:
5454
content: "{{ git_show.stdout }}"
5555
dest: "{{ artifact_extra_logs_dir }}/ci_artifact.git_commit"
56-
mode: 0644
56+
mode: '0644'
5757

5858
- name: Get the cluster nodes status
5959
shell:

roles/cluster/cluster_create_htpasswd_user/defaults/main/config.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# Auto-generated file, do not edit manually ...
1+
# Auto-generated file, do not edit manually ...
22
# Toolbox generate command: repo generate_ansible_default_settings
33
# Source component: Cluster.create_htpasswd_adminuser
44

5+
# Parameters
56
# Username of the htpasswd user.
67
# Mandatory value
78
cluster_create_htpasswd_user_username:
@@ -13,6 +14,7 @@ cluster_create_htpasswd_user_passwordfile:
1314
# If True, waits for the user to be able to login into the cluster.
1415
cluster_create_htpasswd_user_wait: false
1516

17+
# Constants
1618
# Name of the secret that will contain the htpasswd passwords
1719
# Defined as a constant in Cluster.create_htpasswd_adminuser
1820
cluster_create_htpasswd_user_secret_name: htpasswd-secret
@@ -28,4 +30,3 @@ cluster_create_htpasswd_user_role: cluster-admin
2830
# Name of the group that will be created for the user
2931
# Defined as a constant in Cluster.create_htpasswd_adminuser
3032
cluster_create_htpasswd_user_groupname: local-admins
31-

roles/cluster/cluster_create_htpasswd_user/tasks/main.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
template:
3434
src: "{{ cluster_create_htpasswd_user_oauth }}"
3535
dest: "{{ artifact_extra_logs_dir }}/oauth_htpasswd.yaml"
36-
mode: 0400
36+
mode: '0400'
3737

3838
- name: Append the htpasswd OAuth identity provider
3939
shell:
@@ -74,6 +74,7 @@
7474
ansible.builtin.file:
7575
path: /tmp/user_kubeconfig
7676
state: touch
77+
mode: '0644'
7778

7879
- name: Wait for the authentication to work
7980
when: cluster_create_htpasswd_user_wait | bool
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
cluster_create_htpasswd_user_oauth: "roles/cluster/cluster_create_htpasswd_user/templates/oauth.yml.j2"
2+
cluster_create_htpasswd_user_oauth: "roles/cluster/cluster_create_htpasswd_user/templates/oauth.yml.j2"

roles/cluster/cluster_create_osd/defaults/main/config.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# Auto-generated file, do not edit manually ...
1+
# Auto-generated file, do not edit manually ...
22
# Toolbox generate command: repo generate_ansible_default_settings
33
# Source component: Cluster.create_osd
44

5+
# Parameters
56
# The name to give to the cluster.
67
# Mandatory value
78
cluster_create_osd_cluster_name:
@@ -30,6 +31,7 @@ cluster_create_osd_compute_machine_type: m5.xlarge
3031
# Type: Int
3132
cluster_create_osd_compute_nodes: 2
3233

34+
# Constants
3335
# Name of the worker node machinepool
3436
# Defined as a constant in Cluster.create_osd
3537
cluster_create_osd_machinepool_name: default
@@ -41,4 +43,3 @@ cluster_create_osd_kubeadmin_group: cluster-admins
4143
# Name of the admin account that will be created.
4244
# Defined as a constant in Cluster.create_osd
4345
cluster_create_osd_kubeadmin_name: kubeadmin
44-
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# Auto-generated file, do not edit manually ...
1+
# Auto-generated file, do not edit manually ...
22
# Toolbox generate command: repo generate_ansible_default_settings
33
# Source component: Cluster.deploy_aws_efs
4-

roles/cluster/cluster_deploy_aws_efs/tasks/aws-efs.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@
9898
set_fact:
9999
cluster_tags: "{{ cluster_tags | default({}) | combine({item.key: item.value}) }}"
100100
with_items:
101-
- {'key': 'Name' , 'value': '{{ cluster_name_cmd.stdout }}'}
102-
- {'key': '{{ cluster_name_tag_cmd.stdout }}' , 'value': 'owned'}
101+
- {'key': 'Name', 'value': '{{ cluster_name_cmd.stdout }}'}
102+
- {'key': '{{ cluster_name_tag_cmd.stdout }}', 'value': 'owned'}
103103
- {'key': 'Purpose', 'value': ''}
104104

105105
- name: Get the SecurityGroup content

roles/cluster/cluster_deploy_aws_efs/tasks/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
template:
2727
src: "{{ cluster_deploy_aws_efs_csi_driver }}"
2828
dest: "{{ artifact_extra_logs_dir }}/csi-driver.yml"
29-
mode: 0400
29+
mode: '0400'
3030

3131
- name: Create the ClusterCSIDriver resource
3232
command: oc apply -f "{{ artifact_extra_logs_dir }}/csi-driver.yml"
@@ -35,7 +35,7 @@
3535
template:
3636
src: "{{ cluster_deploy_aws_efs_storage_class }}"
3737
dest: "{{ artifact_extra_logs_dir }}/storage-class.yml"
38-
mode: 0400
38+
mode: '0400'
3939

4040
- name: Create the StorageClass resource
4141
command: oc apply -f "{{ artifact_extra_logs_dir }}/storage-class.yml"
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# Auto-generated file, do not edit manually ...
1+
# Auto-generated file, do not edit manually ...
22
# Toolbox generate command: repo generate_ansible_default_settings
33
# Source component: Cluster.deploy_kepler
4-

roles/cluster/cluster_deploy_kepler/tasks/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
git --git-dir "{{ kepler_location }}/.git" show
1717

1818
- name: Deploy kepler-operator
19-
shell:
19+
shell:
2020
cd "{{ kepler_location }}"; make deploy OPERATOR_IMG=quay.io/sustainable_computing_io/kepler-operator:latest
2121
register: deploy_kepler
2222
delay: 3

roles/cluster/cluster_deploy_ldap/defaults/main/config.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# Auto-generated file, do not edit manually ...
1+
# Auto-generated file, do not edit manually ...
22
# Toolbox generate command: repo generate_ansible_default_settings
33
# Source component: Cluster.deploy_ldap
44

5+
# Parameters
56
# Name of the LDAP identity provider.
67
# Mandatory value
78
cluster_deploy_ldap_idp_name:
@@ -31,7 +32,7 @@ cluster_deploy_ldap_cluster_name: null
3132
# If True, waits for the first user (0) to be able to login into the cluster.
3233
cluster_deploy_ldap_wait: false
3334

35+
# Constants
3436
# Name of the admin user
3537
# Defined as a constant in Cluster.deploy_ldap
3638
cluster_deploy_ldap_admin_user: admin
37-

roles/cluster/cluster_deploy_ldap/tasks/main.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
template:
7373
src: "{{ cluster_deploy_ldap_oauth }}"
7474
dest: "{{ artifact_extra_logs_dir }}/oauth_ldap.yaml"
75-
mode: 0400
75+
mode: '0400'
7676

7777
- name: Get LDAP URL
7878
command:
@@ -168,6 +168,7 @@
168168
ansible.builtin.file:
169169
path: /tmp/user_kubeconfig
170170
state: touch
171+
mode: '0644'
171172

172173
- name: Wait for the authentication to work
173174
when: cluster_deploy_ldap_wait | bool

roles/cluster/cluster_deploy_minio_s3_server/defaults/main/config.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# Auto-generated file, do not edit manually ...
1+
# Auto-generated file, do not edit manually ...
22
# Toolbox generate command: repo generate_ansible_default_settings
33
# Source component: Cluster.deploy_minio_s3_server
44

5+
# Parameters
56
# Path of a file containing the properties of S3 secrets.
67
# Mandatory value
78
cluster_deploy_minio_s3_server_secret_properties_file:
@@ -12,11 +13,11 @@ cluster_deploy_minio_s3_server_namespace: minio
1213
# The name of the default bucket to create in Minio.
1314
cluster_deploy_minio_s3_server_bucket_name: myBucket
1415

16+
# Constants
1517
# Name of the Minio admin user
1618
# Defined as a constant in Cluster.deploy_minio_s3_server
1719
cluster_deploy_minio_s3_server_root_user: admin
1820

1921
# Name of the user/access key to use to connect to the Minio server
2022
# Defined as a constant in Cluster.deploy_minio_s3_server
2123
cluster_deploy_minio_s3_server_access_key: minio
22-

roles/cluster/cluster_deploy_nfs_provisioner/defaults/main/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# Auto-generated file, do not edit manually ...
1+
# Auto-generated file, do not edit manually ...
22
# Toolbox generate command: repo generate_ansible_default_settings
33
# Source component: Cluster.deploy_nfs_provisioner
44

5+
# Parameters
56
# The namespace where the resources will be deployed
67
cluster_deploy_nfs_provisioner_namespace: nfs-provisioner
78

@@ -16,4 +17,3 @@ cluster_deploy_nfs_provisioner_storage_class_name: nfs-provisioner
1617

1718
# Set to true to mark the storage class as default in the cluster
1819
cluster_deploy_nfs_provisioner_default_sc: false
19-

roles/cluster/cluster_deploy_nfs_provisioner/files/nfs-server-and-provisioner/deploy/deployment.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ spec:
5454
app: nfs-provisioner
5555
replicas: 1
5656
strategy:
57-
type: Recreate
57+
type: Recreate
5858
template:
5959
metadata:
6060
labels:

roles/cluster/cluster_deploy_nfs_provisioner/files/nfs-server-and-provisioner/deploy/export-pv-claim.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ spec:
88
- ReadWriteOnce
99
resources:
1010
requests:
11-
storage: 500Gi
11+
storage: 500Gi

roles/cluster/cluster_deploy_nfs_provisioner/files/nfs-server-and-provisioner/usage/pod-1.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ spec:
1919
- name: nfs-pvc
2020
persistentVolumeClaim:
2121
claimName: shared-folder
22-

roles/cluster/cluster_deploy_nfs_provisioner/files/nfs-server-and-provisioner/usage/pod-2.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ spec:
1919
- name: nfs-pvc
2020
persistentVolumeClaim:
2121
claimName: shared-folder
22-
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Auto-generated file, do not edit manually ...
1+
# Auto-generated file, do not edit manually ...
22
# Toolbox generate command: repo generate_ansible_default_settings
33
# Source component: Cluster.deploy_nginx_server
44

5+
# Parameters
56
# namespace where the server will be deployed. Will be create if it doesn't exist.
67
# Mandatory value
78
cluster_deploy_nginx_server_namespace:
89

910
# directory containing the files to serve on the HTTP server.
1011
# Mandatory value
1112
cluster_deploy_nginx_server_directory:
12-

roles/cluster/cluster_deploy_operator/defaults/main/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# Auto-generated file, do not edit manually ...
1+
# Auto-generated file, do not edit manually ...
22
# Toolbox generate command: repo generate_ansible_default_settings
33
# Source component: Cluster.deploy_operator
44

5+
# Parameters
56
# Name of the catalog containing the operator.
67
# Mandatory value
78
cluster_deploy_operator_catalog:
@@ -37,4 +38,3 @@ cluster_deploy_operator_namespace_monitoring: false
3738
# If set, deploy the CSV in all the namespaces.
3839
# Type: Bool
3940
cluster_deploy_operator_all_namespaces: false
40-

roles/cluster/cluster_deploy_operator/tasks/main.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@
193193
template:
194194
src: "{{ cluster_deploy_operator_res_ns }}"
195195
dest: "{{ artifact_extra_logs_dir }}/src/000_namespace.yml"
196-
mode: 0400
196+
mode: '0400'
197197

198198
- name: Check if the namespace exists
199199
command: oc get "ns/{{ cluster_deploy_operator_namespace }}"
@@ -217,7 +217,7 @@
217217
template:
218218
src: "{{ cluster_deploy_operator_res_group }}"
219219
dest: "{{ artifact_extra_logs_dir }}/src/001_operator_group.yml"
220-
mode: 0400
220+
mode: '0400'
221221

222222
- name: Instantiate the OperatorHub OperatorGroup resource
223223
command: oc apply -f "{{ artifact_extra_logs_dir }}/src/001_operator_group.yml"
@@ -226,7 +226,7 @@
226226
template:
227227
src: "{{ cluster_deploy_operator_res_sub }}"
228228
dest: "{{ artifact_extra_logs_dir }}/src/002_sub.yml"
229-
mode: 0400
229+
mode: '0400'
230230

231231
- name: Instantiate the Subscription
232232
command: oc apply -f "{{ artifact_extra_logs_dir }}/src/002_sub.yml"
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Auto-generated file, do not edit manually ...
1+
# Auto-generated file, do not edit manually ...
22
# Toolbox generate command: repo generate_ansible_default_settings
33
# Source component: Cluster.deploy_redis_server
44

5+
# Parameters
56
# namespace where the server will be deployed. Will be create if it doesn't exist.
67
# Mandatory value
78
cluster_deploy_redis_server_namespace:
8-

0 commit comments

Comments
 (0)