Skip to content

Commit

Permalink
Disable QA on 'run_once'.
Browse files Browse the repository at this point in the history
Currently, the rule makes no sense and causes false positives for us.
Reference: ansible/ansible-lint#2626
  • Loading branch information
robin-checkmk committed Feb 21, 2023
1 parent 4478007 commit bab6fca
Show file tree
Hide file tree
Showing 11 changed files with 89 additions and 89 deletions.
20 changes: 10 additions & 10 deletions playbooks/demo.yml
Expand Up @@ -15,7 +15,7 @@
sites:
- "{{ site }}"
delegate_to: localhost
run_once: 'true'
run_once: true # noqa run-once

- name: "Create folder."
folder:
Expand All @@ -27,7 +27,7 @@
name: "{{ item.name }}"
state: "present"
delegate_to: localhost
run_once: 'yes'
run_once: true # noqa run-once
loop: "{{ checkmk_folders }}"

- name: "Create host."
Expand Down Expand Up @@ -64,7 +64,7 @@
title: "{{ item.title | default(item.name) }}"
state: "present"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
loop: "{{ checkmk_service_groups_create }}"

- name: "Pause to review first set of changes."
Expand All @@ -83,7 +83,7 @@
sites:
- "{{ site }}"
delegate_to: localhost
run_once: 'true'
run_once: true # noqa run-once

- name: "Change host attributes."
host:
Expand Down Expand Up @@ -121,7 +121,7 @@
title: "{{ item.title | default(item.name) }}"
state: "present"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
loop: "{{ checkmk_contact_groups_create }}"

- name: "Pause to review second set of changes."
Expand Down Expand Up @@ -262,7 +262,7 @@
sites:
- "{{ site }}"
delegate_to: localhost
run_once: 'true'
run_once: true # noqa run-once

- name: "Delete service groups."
service_group:
Expand All @@ -273,7 +273,7 @@
name: "{{ item.name }}"
state: "absent"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
loop: "{{ checkmk_service_groups_create }}"

- name: "Delete contact groups."
Expand All @@ -285,7 +285,7 @@
name: "{{ item.name }}"
state: "absent"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
loop: "{{ checkmk_contact_groups_create }}"

- name: "Delete Host."
Expand All @@ -310,7 +310,7 @@
state: "absent"
register: testout
delegate_to: localhost
run_once: 'yes'
run_once: true # noqa run-once
loop: "{{ checkmk_folders }}"

- name: "Activate changes on site - Showcase host and folders were deleted"
Expand All @@ -323,4 +323,4 @@
sites:
- "{{ site }}"
delegate_to: localhost
run_once: 'true'
run_once: true # noqa run-once
2 changes: 1 addition & 1 deletion roles/agent/handlers/main.yml
Expand Up @@ -8,5 +8,5 @@
automation_secret: "{{ checkmk_agent_auth }}"
force_foreign_changes: "{{ checkmk_agent_force_foreign_changes }}"
delegate_to: "{{ checkmk_agent_delegate_api_calls }}"
run_once: 'true'
run_once: true # noqa run-once
when: checkmk_agent_auto_activate | bool
8 changes: 4 additions & 4 deletions tests/integration/targets/activation/tasks/test.yml
Expand Up @@ -12,7 +12,7 @@
ipaddress: 127.0.0.1
state: "present"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
loop: "{{ checkmk_hosts }}"

- name: "{{ outer_item.version }} - Activate."
Expand All @@ -25,7 +25,7 @@
sites:
- "{{ outer_item.site }}"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once

- name: "{{ outer_item.version }} - Delete hosts."
host:
Expand All @@ -37,7 +37,7 @@
folder: "{{ item.folder }}"
state: "absent"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
loop: "{{ checkmk_hosts }}"

- name: "{{ outer_item.version }} - Activate forcing foreign changes."
Expand All @@ -50,4 +50,4 @@
sites:
- "{{ outer_item.site }}"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
32 changes: 16 additions & 16 deletions tests/integration/targets/contact_group/tasks/test.yml
Expand Up @@ -9,7 +9,7 @@
title: "{{ item.title | default(item.name) }}"
state: "present"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
loop: "{{ checkmk_contact_groups_create }}"

- name: "{{ outer_item.version }} - Should fail because of 'groups', Create contact groups."
Expand All @@ -23,7 +23,7 @@
groups: checkmk_contact_groups_create
state: "present"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
loop: "{{ checkmk_contact_groups_create }}"
ignore_errors: true

Expand All @@ -37,7 +37,7 @@
sites:
- "{{ outer_item.site }}"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once

- name: "{{ outer_item.version }} - Modify part of contact groups (also checks for idempotency!)."
contact_group:
Expand All @@ -49,7 +49,7 @@
title: "{{ item.title }}"
state: "present"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
loop: "{{ checkmk_contact_groups_modify }}"

- name: "{{ outer_item.version }} - Activate."
Expand All @@ -62,7 +62,7 @@
sites:
- "{{ outer_item.site }}"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once

- name: "{{ outer_item.version }} - Delete contact groups."
contact_group:
Expand All @@ -73,7 +73,7 @@
name: "{{ item.name }}"
state: "absent"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
loop: "{{ checkmk_contact_groups_delete }}"

- name: "{{ outer_item.version }} - Activate."
Expand All @@ -86,7 +86,7 @@
sites:
- "{{ outer_item.site }}"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once

- name: "{{ outer_item.version }} - Delete contact groups that were created at the beginning (also check for idempotency)."
contact_group:
Expand All @@ -97,7 +97,7 @@
name: "{{ item.name }}"
state: "absent"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
loop: "{{ checkmk_contact_groups_create }}"

- name: "{{ outer_item.version }} - Activate."
Expand All @@ -110,7 +110,7 @@
sites:
- "{{ outer_item.site }}"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once

- name: "{{ outer_item.version }} - Bulk create contact groups."
contact_group:
Expand All @@ -121,7 +121,7 @@
groups: "{{ checkmk_contact_groups_create }}"
state: "present"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once

- name: "{{ outer_item.version }} - Should fail because of 'name', Bulk create contact groups."
contact_group:
Expand All @@ -133,7 +133,7 @@
name: "test"
state: "present"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
ignore_errors: true

- name: "{{ outer_item.version }} - Should fail because of 'title', Bulk create contact groups."
Expand All @@ -146,7 +146,7 @@
title: "Test"
state: "present"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
ignore_errors: true

- name: "{{ outer_item.version }} - Bulk modify part of contact groups (also checks for idempotency!)."
Expand All @@ -158,7 +158,7 @@
groups: "{{ checkmk_contact_groups_modify }}"
state: "present"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once

- name: "{{ outer_item.version }} - Bulk delete contact groups."
contact_group:
Expand All @@ -169,7 +169,7 @@
groups: "{{ checkmk_contact_groups_delete }}"
state: "absent"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once

- name: "{{ outer_item.version }} - Bulk delete contact groups that were created at the beginning (also check for idempotency)."
contact_group:
Expand All @@ -180,7 +180,7 @@
groups: "{{ checkmk_contact_groups_create }}"
state: "absent"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once

- name: "{{ outer_item.version }} - Activate."
activation:
Expand All @@ -192,4 +192,4 @@
sites:
- "{{ outer_item.site }}"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
10 changes: 5 additions & 5 deletions tests/integration/targets/discovery/tasks/test.yml
Expand Up @@ -12,7 +12,7 @@
ipaddress: 127.0.0.1
state: "present"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
loop: "{{ checkmk_hosts }}"

- name: "{{ outer_item.version }} - Discover hosts."
Expand All @@ -24,7 +24,7 @@
host_name: "{{ item.name }}"
state: "fix_all"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
loop: "{{ checkmk_hosts }}"

- name: "{{ outer_item.version }} - Activate."
Expand All @@ -37,7 +37,7 @@
sites:
- "{{ outer_item.site }}"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once

- name: "{{ outer_item.version }} - Delete hosts."
host:
Expand All @@ -49,7 +49,7 @@
folder: "{{ item.folder }}"
state: "absent"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
loop: "{{ checkmk_hosts }}"

- name: "{{ outer_item.version }} - Activate."
Expand All @@ -61,4 +61,4 @@
sites:
- "{{ outer_item.site }}"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
10 changes: 5 additions & 5 deletions tests/integration/targets/downtime/tasks/test.yml
Expand Up @@ -12,7 +12,7 @@
ipaddress: 127.0.0.1
state: "present"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
loop: "{{ checkmk_hosts }}"

- name: "{{ outer_item.version }} - Discover hosts."
Expand All @@ -24,7 +24,7 @@
host_name: "{{ item.name }}"
state: "fix_all"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
loop: "{{ checkmk_hosts }}"

- name: "{{ outer_item.version }} - Run activation."
Expand All @@ -35,7 +35,7 @@
automation_secret: "{{ automation_secret }}"
force_foreign_changes: true
delegate_to: localhost
run_once: true
run_once: true # noqa run-once

- name: "{{ outer_item.version }} - Schedule downtime on services with relative times."
downtime:
Expand Down Expand Up @@ -266,7 +266,7 @@
folder: "{{ item.folder }}"
state: "absent"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
loop: "{{ checkmk_hosts }}"

- name: "{{ outer_item.version }} - Run activation."
Expand All @@ -277,4 +277,4 @@
automation_secret: "{{ automation_secret }}"
force_foreign_changes: true
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
8 changes: 4 additions & 4 deletions tests/integration/targets/folder/tasks/test.yml
Expand Up @@ -12,7 +12,7 @@
name: "{{ item.name }}"
state: "present"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
loop: "{{ checkmk_folders }}"

- name: "{{ outer_item.version }} - Activate."
Expand All @@ -25,7 +25,7 @@
sites:
- "{{ outer_item.site }}"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once

- name: "{{ outer_item.version }} - Delete folders."
folder:
Expand All @@ -37,7 +37,7 @@
name: "{{ item.name }}"
state: "absent"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once
loop: "{{ checkmk_folders }}"

- name: "{{ outer_item.version }} - Activate."
Expand All @@ -50,4 +50,4 @@
sites:
- "{{ outer_item.site }}"
delegate_to: localhost
run_once: true
run_once: true # noqa run-once

0 comments on commit bab6fca

Please sign in to comment.