From c01e6081d132335707d98d955dae4fa7f4c97b07 Mon Sep 17 00:00:00 2001 From: Lars Getwan Date: Tue, 24 Oct 2023 08:26:11 +0200 Subject: [PATCH 1/3] Fix yamllint issues. --- playbooks/demo/lookup.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/playbooks/demo/lookup.yml b/playbooks/demo/lookup.yml index c415bb253..768f5b0e9 100644 --- a/playbooks/demo/lookup.yml +++ b/playbooks/demo/lookup.yml @@ -26,7 +26,7 @@ ansible.builtin.debug: msg: "Folder tree: {{ item.id }}" loop: "{{ - lookup('checkmk.general.all_folders', + lookup('checkmk.general.all_folders', '~', show_hosts=False, recursive=True, @@ -37,14 +37,14 @@ ) }}" loop_control: - label: "{{ item.id }}" - + label: "{{ item.id }}" + - name: "Get all hosts of the folder /test recursively" ansible.builtin.debug: msg: "Host found in {{ item.0.id }}: {{ item.1.title }}" vars: looping: "{{ - lookup('checkmk.general.all_folders', + lookup('checkmk.general.all_folders', '~tests', show_hosts=True, recursive=True, @@ -56,14 +56,14 @@ }}" loop: "{{ looping|subelements('members.hosts.value') }}" loop_control: - label: "{{ item.0.id }}" + label: "{{ item.0.id }}" - name: "Get the attributes of folder /tests" ansible.builtin.debug: msg: "Attributes of folder /network: {{ attributes }}" vars: attributes: "{{ - lookup('checkmk.general.folder', + lookup('checkmk.general.folder', '~tests', site_url=server_url + '/' + site, automation_user=automation_user, From 8de60353963601c80478b443aaab71ff2fcbc465 Mon Sep 17 00:00:00 2001 From: Lars Getwan Date: Tue, 24 Oct 2023 08:50:58 +0200 Subject: [PATCH 2/3] Fix unexpected yamllint issues. --- playbooks/demo/lookup.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/playbooks/demo/lookup.yml b/playbooks/demo/lookup.yml index 768f5b0e9..3052e2948 100644 --- a/playbooks/demo/lookup.yml +++ b/playbooks/demo/lookup.yml @@ -16,11 +16,11 @@ server_url + '/' + site, validate_certs=False, automation_user=automation_user, - automation_secret=automation_secret - )}}" + automation_secret=automation_secret) + }}" delegate_to: localhost - run_once: 'true' + run_once: true - name: "Get all subfolders of the main folder recursively" ansible.builtin.debug: @@ -33,8 +33,7 @@ site_url=server_url + '/' + site, automation_user=automation_user, automation_secret=automation_secret, - validate_certs=False - ) + validate_certs=False) }}" loop_control: label: "{{ item.id }}" @@ -51,8 +50,7 @@ site_url=server_url + '/' + site, automation_user=automation_user, automation_secret=automation_secret, - validate_certs=False - ) + validate_certs=False) }}" loop: "{{ looping|subelements('members.hosts.value') }}" loop_control: @@ -68,7 +66,6 @@ site_url=server_url + '/' + site, automation_user=automation_user, automation_secret=automation_secret, - validate_certs=False - ) + validate_certs=False) }}" delegate_to: localhost From 6bb0e1b06fed816523e2572bf972523a5f8a1703 Mon Sep 17 00:00:00 2001 From: Lars Getwan Date: Tue, 24 Oct 2023 09:09:11 +0200 Subject: [PATCH 3/3] Fix more unexpected yamllint issues. --- playbooks/demo/lookup.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/playbooks/demo/lookup.yml b/playbooks/demo/lookup.yml index 3052e2948..96545907d 100644 --- a/playbooks/demo/lookup.yml +++ b/playbooks/demo/lookup.yml @@ -18,9 +18,8 @@ automation_user=automation_user, automation_secret=automation_secret) }}" - delegate_to: localhost - run_once: true + run_once: true # noqa run-once[task] - name: "Get all subfolders of the main folder recursively" ansible.builtin.debug: @@ -37,6 +36,8 @@ }}" loop_control: label: "{{ item.id }}" + delegate_to: localhost + run_once: true # noqa run-once[task] - name: "Get all hosts of the folder /test recursively" ansible.builtin.debug: @@ -52,9 +53,11 @@ automation_secret=automation_secret, validate_certs=False) }}" - loop: "{{ looping|subelements('members.hosts.value') }}" + loop: "{{ looping | subelements('members.hosts.value') }}" loop_control: label: "{{ item.0.id }}" + delegate_to: localhost + run_once: true # noqa run-once[task] - name: "Get the attributes of folder /tests" ansible.builtin.debug: @@ -69,3 +72,4 @@ validate_certs=False) }}" delegate_to: localhost + run_once: true # noqa run-once[task]