Skip to content
Snippets Groups Projects
Commit e7d354c2 authored by Rafael Guterres Jeffman's avatar Rafael Guterres Jeffman
Browse files

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'.
parent 0782e260
No related branches found
No related tags found
No related merge requests found
Showing
with 30 additions and 15 deletions
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
ipaapi_context: "{{ ipa_context | default(omit) }}" ipaapi_context: "{{ ipa_context | default(omit) }}"
register: previousconfig register: previousconfig
- debug: - name: Display current configuration.
debug:
var: previousconfig var: previousconfig
# setup environment. # setup environment.
...@@ -478,7 +479,8 @@ ...@@ -478,7 +479,8 @@
ca_renewal_master_server: '{{ previousconfig.config.ca_renewal_master_server | default(omit) }}' ca_renewal_master_server: '{{ previousconfig.config.ca_renewal_master_server | default(omit) }}'
register: result 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." msg: "Due to a test failure, IPA CA-Renewal Server might not be correctly be set. Check your configuration."
always: always:
......
...@@ -33,7 +33,8 @@ ...@@ -33,7 +33,8 @@
register: ipahost register: ipahost
failed_when: not ipahost.changed or ipahost.failed failed_when: not ipahost.changed or ipahost.failed
- assert: - name: Assert ipahost.host.randompassword is defined.
assert:
that: that:
- ipahost.host.randompassword is defined - ipahost.host.randompassword is defined
...@@ -62,7 +63,8 @@ ...@@ -62,7 +63,8 @@
register: ipahost register: ipahost
failed_when: not ipahost.changed or ipahost.failed failed_when: not ipahost.changed or ipahost.failed
- assert: - name: Assert randompassword is defined for host1 and host2.
assert:
that: that:
- ipahost.host["{{ host1_fqdn }}"].randompassword is - ipahost.host["{{ host1_fqdn }}"].randompassword is
defined defined
...@@ -87,7 +89,8 @@ ...@@ -87,7 +89,8 @@
register: ipahost register: ipahost
failed_when: ipahost.changed or not ipahost.failed failed_when: ipahost.changed or not ipahost.failed
- assert: - name: Assert randompassword is not defined for 'ansible_fqdn'.
assert:
that: that:
- ipahost.host["{{ ansible_facts['fqdn'] }}"].randompassword is - ipahost.host["{{ ansible_facts['fqdn'] }}"].randompassword is
not defined not defined
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
hosts: ipaserver hosts: ipaserver
tasks: tasks:
- ipadnszone: - name: Ensure DNS zone is present with multiple forwarders
ipadnszone:
ipaadmin_password: SomeADMINpassword ipaadmin_password: SomeADMINpassword
name: 04testzone.test name: 04testzone.test
forwarders: forwarders:
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
hosts: ipaserver hosts: ipaserver
tasks: tasks:
- ipadnszone: - name: Ensure DNS zone is present without forwarders
ipadnszone:
ipaadmin_password: SomeADMINpassword ipaadmin_password: SomeADMINpassword
name: 01testzone.test name: 01testzone.test
forwarders: [] forwarders: []
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
become: true become: true
tasks: tasks:
- ipadnszone: - name: Ensure multiple DNS are absent
ipadnszone:
ipaadmin_password: SomeADMINpassword ipaadmin_password: SomeADMINpassword
name: delzone1.com,delzone2.com,delzone3.com name: delzone1.com,delzone2.com,delzone3.com
state: absent state: absent
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
hosts: ipaserver hosts: ipaserver
tasks: tasks:
- ipadnszone: - name: Ensure DNS zone is disabled
ipadnszone:
ipaadmin_password: SomeADMINpassword ipaadmin_password: SomeADMINpassword
name: 26testzone.test name: 26testzone.test
state: disabled state: disabled
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
hosts: ipaserver hosts: ipaserver
tasks: tasks:
- ipadnszone: - name: Ensure DNS zone is enabled
ipadnszone:
ipaadmin_password: SomeADMINpassword ipaadmin_password: SomeADMINpassword
name: 26testzone.test name: 26testzone.test
state: enabled state: enabled
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
become: true become: true
tasks: tasks:
- ipadnszone: - name: Test adding a DNS zone with an invalid forwarder
ipadnszone:
ipaadmin_password: SomeADMINpassword ipaadmin_password: SomeADMINpassword
name: invalidzone.test name: invalidzone.test
forwarders: forwarders:
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
become: true become: true
tasks: tasks:
- ipadnszone: - name: Test adding a DNS zone with an invalid serial
ipadnszone:
ipaadmin_password: SomeADMINpassword ipaadmin_password: SomeADMINpassword
name: invalidserialzone.test name: invalidserialzone.test
serial: 429496729599 serial: 429496729599
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
hosts: ipaserver hosts: ipaserver
tasks: tasks:
- ipadnszone: - name: Ensure a reverse DNS Zone with name inferred form an IP address
ipadnszone:
ipaadmin_password: SomeADMINpassword ipaadmin_password: SomeADMINpassword
name_from_ip: 192.8.2.0/22 name_from_ip: 192.8.2.0/22
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
hosts: ipaserver hosts: ipaserver
tasks: tasks:
- ipadnszone: - name: Ensure DNS Zone is present with forward policy `only`
ipadnszone:
ipaadmin_password: SomeADMINpassword ipaadmin_password: SomeADMINpassword
name: 26testzone.test name: 26testzone.test
forward_policy: only forward_policy: only
...@@ -13,7 +13,8 @@ ...@@ -13,7 +13,8 @@
- name: Include users.json - name: Include users.json
include_vars: include_vars:
file: users.json file: users.json
- debug: - name: Size of users slice.
debug:
msg: "{{ users | length }}" msg: "{{ users | length }}"
- name: Users present - name: Users present
ipauser: ipauser:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment