Skip to content

Commit

Permalink
cleaning - remove "roles/" prefix when include_role
Browse files Browse the repository at this point in the history
Change-Id: I95fd7c859271356c03f0a2c515dc87dedd007860
  • Loading branch information
morucci committed Oct 23, 2023
1 parent 761798e commit 57b55ee
Show file tree
Hide file tree
Showing 16 changed files with 38 additions and 39 deletions.
2 changes: 1 addition & 1 deletion roles/apply-custom-resources/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
chdir: "{{ zuul.project.src_dir }}"

- ansible.builtin.include_role:
name: "roles/health-check/check-sf-resource-ready"
name: "health-check/check-sf-resource-ready"
2 changes: 1 addition & 1 deletion roles/build-operator-assets/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
block:
- name: Setup local registry
ansible.builtin.include_role:
name: "roles/setup-local-registry"
name: "setup-local-registry"
when:
- build_bundle | default(true)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
- "git commit -m 'Add nodepool/nodepool-builder.yaml'"

- ansible.builtin.include_role:
name: "roles/health-check/config-repo-submit-change"
name: "health-check/config-repo-submit-change"
vars:
ensure_config_check_failure: true

Expand Down Expand Up @@ -127,7 +127,7 @@

- name: Update config repo change
ansible.builtin.include_role:
name: "roles/health-check/config-repo-submit-change"
name: "health-check/config-repo-submit-change"

- name: "Check that {{ nodepool_diskimage_name }} label exists in the destination file"
ansible.builtin.shell: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
- "git commit -m 'Add nodepool/nodepool.yaml'"

- ansible.builtin.include_role:
name: "roles/health-check/config-repo-submit-change"
name: "health-check/config-repo-submit-change"
vars:
ensure_config_check_failure: true

Expand Down Expand Up @@ -118,7 +118,7 @@

- name: Update config repo change
ansible.builtin.include_role:
name: "roles/health-check/config-repo-submit-change"
name: "health-check/config-repo-submit-change"

- name: Get nodepool-launcher pod name
ansible.builtin.shell: |
Expand Down
8 changes: 4 additions & 4 deletions roles/health-check/config-update-zuul/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
tenant_name: "ichiban-tenant-{{ random }}"

- ansible.builtin.include_role:
name: "roles/create-gerrit-repository"
name: "create-gerrit-repository"

# First attempt a negative test where we expect a failure
- name: Set bad Zuul tenant config
Expand All @@ -47,7 +47,7 @@
- "git commit -m 'Add {{ config_path }}/zuul/main.yaml'"

- ansible.builtin.include_role:
name: "roles/health-check/config-repo-submit-change"
name: "health-check/config-repo-submit-change"
vars:
ensure_config_check_failure: true

Expand Down Expand Up @@ -76,15 +76,15 @@
vars:
check_zuul_console: true
ansible.builtin.include_role:
name: "roles/health-check/config-repo-submit-change"
name: "health-check/config-repo-submit-change"

- ansible.builtin.set_fact:
zuul_config_update_build_log_url: "{{ (zuul_job_result.json | list)[0].log_url }}"
check_gz_redirection: true

- name: Check that Zuul has pushed the job console on the logserver
ansible.builtin.include_role:
name: "roles/health-check/ensure-job-result-artifacts"
name: "health-check/ensure-job-result-artifacts"
vars:
log_url: "{{ zuul_config_update_build_log_url }}"

Expand Down
2 changes: 1 addition & 1 deletion roles/health-check/expand-volume/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

- name: Expand logserver volume
ansible.builtin.include_role:
name: "roles/update-custom-resource"
name: "update-custom-resource"
vars:
cr_spec:
logserver:
Expand Down
2 changes: 1 addition & 1 deletion roles/health-check/scale-resources/tasks/scale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- name: "Scale {{ operation }} on statefulset {{ service.name }}"
ansible.builtin.include_role:
name: "roles/update-custom-resource"
name: "update-custom-resource"
vars:
cr_spec: "{{ service['scale_' + operation + '_resources'] }}"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Update SF CR to set Let's Encrypt
ansible.builtin.include_role:
name: "roles/update-custom-resource"
name: "update-custom-resource"
vars:
check_sf_resource_ready: false
cr_spec:
Expand Down Expand Up @@ -45,7 +45,7 @@

- name: Update SF CR to unset Let's Encrypt
ansible.builtin.include_role:
name: "roles/update-custom-resource"
name: "update-custom-resource"
vars:
cr_spec:
letsEncrypt:
2 changes: 1 addition & 1 deletion roles/health-check/test-custom-route-certs/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
ansible.builtin.include_tasks: add_ssl_secret.yaml

- ansible.builtin.include_role:
name: "roles/health-check/check-sf-resource-ready"
name: "health-check/check-sf-resource-ready"

- name: Check SSL for the route
ansible.builtin.include_tasks: check_route.yaml
18 changes: 9 additions & 9 deletions roles/health-check/test-monitoring/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- name: Fetch defined Prometheus targets
ansible.builtin.shell: curl -k https://{{ prometheus_host }}/api/v1/targets | jq '.data.activeTargets[] | select(.labels.container == "{{ item }}") | .health'
register: target_health
failed_when: "\"up\" not in target_health.stdout"
failed_when: '"up" not in target_health.stdout'
loop:
- "zuul-web"
- "zuul-executor"
Expand All @@ -26,7 +26,7 @@
- name: Fetch defined alerts for logserver
ansible.builtin.shell: curl -k https://{{ prometheus_host }}/api/v1/rules | jq '.data.groups[] | select(.name == "disk_default.rules") | .rules[] | select(.name == "{{ item }}") | .health'
register: logserver_alert
failed_when: "\"ok\" not in logserver_alert.stdout"
failed_when: '"ok" not in logserver_alert.stdout'
loop:
- "OutOfDiskNow"
- "OutOfDiskInThreeDays"
Expand Down Expand Up @@ -66,7 +66,7 @@
- name: configure clouds.yaml in sfconfig.yaml
ansible.builtin.lineinfile:
path: "{{ zuul.project.src_dir }}/sfconfig.yaml"
regexp: '^ clouds_file:'
regexp: "^ clouds_file:"
line: " clouds_file: /tmp/test-clouds.yaml"

- name: Upload clouds secrets to nodepool
Expand All @@ -76,26 +76,26 @@

- name: Wait for secrets to be updated
ansible.builtin.include_role:
name: "roles/health-check/check-sf-resource-ready"
name: "health-check/check-sf-resource-ready"

- name: Ensure statsd mapping config has custom mappings from clouds.yaml
ansible.builtin.command: kubectl get configmap np-statsd-config-map -o jsonpath='{.data}'
register: statsd_mappings

- name: Ensure statsd mapping config has custom mappings from clouds.yaml
fail:
msg: "statsd mapping configuration has no reference to clouds config"
when: ("nodepool.openstack.nimbus" not in statsd_mappings.stdout) or
("nodepool.openstack.cumulus" not in statsd_mappings.stdout) or
("nodepool.openstack.*.*.*.*" not in statsd_mappings.stdout)
("nodepool.openstack.cumulus" not in statsd_mappings.stdout) or
("nodepool.openstack.*.*.*.*" not in statsd_mappings.stdout)

- name: Fetch OpenStack API alerts
ansible.builtin.shell: curl -k https://{{ prometheus_host }}/api/v1/rules | jq '.data.groups[] | select(.name == "providersAPI_default.rules") | .rules[] | select(.name == "{{ item }}") | .health'
register: logserver_alert
until: "\"ok\" in logserver_alert.stdout"
until: '"ok" in logserver_alert.stdout'
loop:
- "HighOpenStackAPIError5xxRate"
- "HighOpenStackAPIError5xxRate_nimbus"
- "HighOpenStackAPIError5xxRate_cumulus"
retries: 6
delay: 10
delay: 10
8 changes: 4 additions & 4 deletions roles/health-check/validate-purgelogs/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
- name: Change logserver/purgelogs loop delay
ansible.builtin.include_role:
name: "roles/update-custom-resource"
name: "update-custom-resource"
vars:
cr_spec:
logserver:
loopDelay: 5

- name: Ensure job results exists in Logserver
ansible.builtin.include_role:
name: "roles/health-check/ensure-job-result-artifacts"
name: "health-check/ensure-job-result-artifacts"
vars:
log_url: "{{ zuul_config_update_build_log_url }}"

Expand Down Expand Up @@ -44,7 +44,7 @@
- name: Ensure job results do not exist in Logserver after purging
ansible.builtin.include_role:
name: "roles/health-check/ensure-job-result-artifacts"
name: "health-check/ensure-job-result-artifacts"
vars:
log_url: "{{ zuul_config_update_build_log_url }}"
status: 404
Expand All @@ -56,6 +56,6 @@
- name: Ensure logserver content restoring worked
ansible.builtin.include_role:
name: "roles/health-check/ensure-job-result-artifacts"
name: "health-check/ensure-job-result-artifacts"
vars:
log_url: "{{ zuul_config_update_build_log_url }}"
4 changes: 2 additions & 2 deletions roles/health-check/zuul-authenticators/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

- name: Add the authenticator to spec
ansible.builtin.include_role:
name: "roles/update-custom-resource"
name: "update-custom-resource"
vars:
cr_spec:
zuul:
Expand All @@ -28,7 +28,7 @@

- name: Remove the test authenticator from the spec
ansible.builtin.include_role:
name: "roles/update-custom-resource"
name: "update-custom-resource"
vars:
cr_spec:
zuul:
Expand Down
5 changes: 2 additions & 3 deletions roles/health-check/zuul-connections/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

- name: Add a dummy Zuul Gerrit connection
ansible.builtin.include_role:
name: "roles/update-custom-resource"
name: "update-custom-resource"
vars:
cr_spec:
zuul:
Expand All @@ -43,7 +43,7 @@

- name: Delete the dummy Zuul Gerrit connection
ansible.builtin.include_role:
name: "roles/update-custom-resource"
name: "update-custom-resource"
vars:
cr_spec:
zuul:
Expand All @@ -62,4 +62,3 @@
- "'dummy-github-conn' not in this.content"
retries: "{{ retries }}"
delay: "{{ delay }}"

6 changes: 3 additions & 3 deletions roles/run-tests/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

- name: Iterate on preparation roles
ansible.builtin.include_role:
name: "roles/utils/{{ role }}"
name: "utils/{{ role }}"
loop:
- manage-hosts
- get-gerrit-admin-user-api-key
Expand All @@ -14,7 +14,7 @@

- name: Iterate on tests
ansible.builtin.include_role:
name: "roles/health-check/{{ role }}"
name: "health-check/{{ role }}"
loop:
- check-service-uri
- zuul-connections
Expand All @@ -37,7 +37,7 @@

- name: Check scaling
ansible.builtin.include_role:
name: roles/health-check/scale-resources
name: health-check/scale-resources
loop:
- up
- down
Expand Down
2 changes: 1 addition & 1 deletion roles/update-custom-resource/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
spec: "{{ cr_spec }}"

- ansible.builtin.include_role:
name: "roles/health-check/check-sf-resource-ready"
name: "health-check/check-sf-resource-ready"
when: check_sf_resource_ready | default(true)
4 changes: 2 additions & 2 deletions roles/upgrade-operator/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

- name: Ensure operator expected version ready
ansible.builtin.include_role:
name: roles/check-operator-version
name: check-operator-version
vars:
upgrade_version: "v{{ gen_bundle_version.stdout }}.0.0"

Expand All @@ -68,6 +68,6 @@
# by the new version 'reconciledBy' field.
- name: Wait for operand ready
ansible.builtin.include_role:
name: roles/health-check/check-sf-resource-ready
name: health-check/check-sf-resource-ready
vars:
reconciledBy: "sf-operator.v{{ gen_bundle_version.stdout }}.0.0"

0 comments on commit 57b55ee

Please sign in to comment.