From e7d354c2d48423def8690b54ec029bd83a592329 Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman Date: Thu, 26 Nov 2020 18:01:17 -0300 Subject: [PATCH] Fix ansible-lint E502 for test playbooks. This patch adds 'name' to all test playbook tasks that did not have it, fixing ansible-lint's error 'unnamed-task'. --- tests/config/test_config.yml | 6 ++++-- tests/host/test_host_random.yml | 9 ++++++--- .../dnszone_add_multiple_ipv4_ipv6_forwarders.yaml | 3 ++- .../dnszone/playbooks/dnszone_add_without_forwarder.yaml | 3 ++- .../pytests/dnszone/playbooks/dnszone_del_multiple.yaml | 3 ++- tests/pytests/dnszone/playbooks/dnszone_disable.yaml | 3 ++- tests/pytests/dnszone/playbooks/dnszone_enable.yaml | 3 ++- tests/pytests/dnszone/playbooks/dnszone_invalid_ip.yaml | 3 ++- .../dnszone/playbooks/dnszone_invalid_serial.yaml | 3 ++- .../pytests/dnszone/playbooks/dnszone_name_from_ip.yaml | 3 ++- .../playbooks/dnszone_with_forward_policy_only.yaml | 3 ++- tests/user/test_users_present_slice.yml | 3 ++- 12 files changed, 30 insertions(+), 15 deletions(-) diff --git a/tests/config/test_config.yml b/tests/config/test_config.yml index 01c1913f..c3f26872 100644 --- a/tests/config/test_config.yml +++ b/tests/config/test_config.yml @@ -15,7 +15,8 @@ ipaapi_context: "{{ ipa_context | default(omit) }}" register: previousconfig - - debug: + - name: Display current configuration. + debug: var: previousconfig # setup environment. @@ -478,7 +479,8 @@ ca_renewal_master_server: '{{ previousconfig.config.ca_renewal_master_server | default(omit) }}' register: result - - debug: + - name: "CA-Renewal server warning." + debug: msg: "Due to a test failure, IPA CA-Renewal Server might not be correctly be set. Check your configuration." always: diff --git a/tests/host/test_host_random.yml b/tests/host/test_host_random.yml index 4a2b3a1e..8b9a2c08 100644 --- a/tests/host/test_host_random.yml +++ b/tests/host/test_host_random.yml @@ -33,7 +33,8 @@ register: ipahost failed_when: not ipahost.changed or ipahost.failed - - assert: + - name: Assert ipahost.host.randompassword is defined. + assert: that: - ipahost.host.randompassword is defined @@ -62,7 +63,8 @@ register: ipahost failed_when: not ipahost.changed or ipahost.failed - - assert: + - name: Assert randompassword is defined for host1 and host2. + assert: that: - ipahost.host["{{ host1_fqdn }}"].randompassword is defined @@ -87,7 +89,8 @@ register: ipahost failed_when: ipahost.changed or not ipahost.failed - - assert: + - name: Assert randompassword is not defined for 'ansible_fqdn'. + assert: that: - ipahost.host["{{ ansible_facts['fqdn'] }}"].randompassword is not defined diff --git a/tests/pytests/dnszone/playbooks/dnszone_add_multiple_ipv4_ipv6_forwarders.yaml b/tests/pytests/dnszone/playbooks/dnszone_add_multiple_ipv4_ipv6_forwarders.yaml index 6f42ded5..3607d440 100644 --- a/tests/pytests/dnszone/playbooks/dnszone_add_multiple_ipv4_ipv6_forwarders.yaml +++ b/tests/pytests/dnszone/playbooks/dnszone_add_multiple_ipv4_ipv6_forwarders.yaml @@ -3,7 +3,8 @@ hosts: ipaserver tasks: - - ipadnszone: + - name: Ensure DNS zone is present with multiple forwarders + ipadnszone: ipaadmin_password: SomeADMINpassword name: 04testzone.test forwarders: diff --git a/tests/pytests/dnszone/playbooks/dnszone_add_without_forwarder.yaml b/tests/pytests/dnszone/playbooks/dnszone_add_without_forwarder.yaml index d6ad54de..2446c576 100644 --- a/tests/pytests/dnszone/playbooks/dnszone_add_without_forwarder.yaml +++ b/tests/pytests/dnszone/playbooks/dnszone_add_without_forwarder.yaml @@ -3,7 +3,8 @@ hosts: ipaserver tasks: - - ipadnszone: + - name: Ensure DNS zone is present without forwarders + ipadnszone: ipaadmin_password: SomeADMINpassword name: 01testzone.test forwarders: [] diff --git a/tests/pytests/dnszone/playbooks/dnszone_del_multiple.yaml b/tests/pytests/dnszone/playbooks/dnszone_del_multiple.yaml index 2b631e1d..0de57cc9 100644 --- a/tests/pytests/dnszone/playbooks/dnszone_del_multiple.yaml +++ b/tests/pytests/dnszone/playbooks/dnszone_del_multiple.yaml @@ -4,7 +4,8 @@ become: true tasks: - - ipadnszone: + - name: Ensure multiple DNS are absent + ipadnszone: ipaadmin_password: SomeADMINpassword name: delzone1.com,delzone2.com,delzone3.com state: absent diff --git a/tests/pytests/dnszone/playbooks/dnszone_disable.yaml b/tests/pytests/dnszone/playbooks/dnszone_disable.yaml index c10a2497..a97674a2 100644 --- a/tests/pytests/dnszone/playbooks/dnszone_disable.yaml +++ b/tests/pytests/dnszone/playbooks/dnszone_disable.yaml @@ -3,7 +3,8 @@ hosts: ipaserver tasks: - - ipadnszone: + - name: Ensure DNS zone is disabled + ipadnszone: ipaadmin_password: SomeADMINpassword name: 26testzone.test state: disabled diff --git a/tests/pytests/dnszone/playbooks/dnszone_enable.yaml b/tests/pytests/dnszone/playbooks/dnszone_enable.yaml index 47783a54..8f6a3a98 100644 --- a/tests/pytests/dnszone/playbooks/dnszone_enable.yaml +++ b/tests/pytests/dnszone/playbooks/dnszone_enable.yaml @@ -3,7 +3,8 @@ hosts: ipaserver tasks: - - ipadnszone: + - name: Ensure DNS zone is enabled + ipadnszone: ipaadmin_password: SomeADMINpassword name: 26testzone.test state: enabled diff --git a/tests/pytests/dnszone/playbooks/dnszone_invalid_ip.yaml b/tests/pytests/dnszone/playbooks/dnszone_invalid_ip.yaml index 59142bfd..d16cff75 100644 --- a/tests/pytests/dnszone/playbooks/dnszone_invalid_ip.yaml +++ b/tests/pytests/dnszone/playbooks/dnszone_invalid_ip.yaml @@ -4,7 +4,8 @@ become: true tasks: - - ipadnszone: + - name: Test adding a DNS zone with an invalid forwarder + ipadnszone: ipaadmin_password: SomeADMINpassword name: invalidzone.test forwarders: diff --git a/tests/pytests/dnszone/playbooks/dnszone_invalid_serial.yaml b/tests/pytests/dnszone/playbooks/dnszone_invalid_serial.yaml index 32c87695..1611035a 100644 --- a/tests/pytests/dnszone/playbooks/dnszone_invalid_serial.yaml +++ b/tests/pytests/dnszone/playbooks/dnszone_invalid_serial.yaml @@ -4,7 +4,8 @@ become: true tasks: - - ipadnszone: + - name: Test adding a DNS zone with an invalid serial + ipadnszone: ipaadmin_password: SomeADMINpassword name: invalidserialzone.test serial: 429496729599 diff --git a/tests/pytests/dnszone/playbooks/dnszone_name_from_ip.yaml b/tests/pytests/dnszone/playbooks/dnszone_name_from_ip.yaml index df8498a6..c8fb026e 100644 --- a/tests/pytests/dnszone/playbooks/dnszone_name_from_ip.yaml +++ b/tests/pytests/dnszone/playbooks/dnszone_name_from_ip.yaml @@ -3,6 +3,7 @@ hosts: ipaserver tasks: - - ipadnszone: + - name: Ensure a reverse DNS Zone with name inferred form an IP address + ipadnszone: ipaadmin_password: SomeADMINpassword name_from_ip: 192.8.2.0/22 diff --git a/tests/pytests/dnszone/playbooks/dnszone_with_forward_policy_only.yaml b/tests/pytests/dnszone/playbooks/dnszone_with_forward_policy_only.yaml index d71c3904..a32d0bb5 100644 --- a/tests/pytests/dnszone/playbooks/dnszone_with_forward_policy_only.yaml +++ b/tests/pytests/dnszone/playbooks/dnszone_with_forward_policy_only.yaml @@ -3,7 +3,8 @@ hosts: ipaserver tasks: - - ipadnszone: + - name: Ensure DNS Zone is present with forward policy `only` + ipadnszone: ipaadmin_password: SomeADMINpassword name: 26testzone.test forward_policy: only diff --git a/tests/user/test_users_present_slice.yml b/tests/user/test_users_present_slice.yml index 90f08c5c..6824ada2 100644 --- a/tests/user/test_users_present_slice.yml +++ b/tests/user/test_users_present_slice.yml @@ -13,7 +13,8 @@ - name: Include users.json include_vars: file: users.json - - debug: + - name: Size of users slice. + debug: msg: "{{ users | length }}" - name: Users present ipauser: