Skip to content

Commit

Permalink
Merge pull request #1026 from t-woerner/ansible_lint_tests
Browse files Browse the repository at this point in the history
Ansible lint tests
  • Loading branch information
rjeffman authored Jan 17, 2023
2 parents 7b470ce + 414dc06 commit 308d970
Show file tree
Hide file tree
Showing 61 changed files with 256 additions and 256 deletions.
2 changes: 2 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ skip_list:
- '305' # Use shell only when shell functionality is required
- '306' # risky-shell-pipe
- yaml # yamllint should be executed separately.
- experimental # Do not run any experimental tests
- name[template] # Allow Jinja templating inside task names

use_default_rules: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
pip install "ansible-core >=2.14,<2.15" ansible-lint
utils/build-galaxy-release.sh -ki
cd .galaxy-build
ansible-lint roles plugins
ansible-lint
yamllint:
name: Verify yamllint
Expand Down
2 changes: 1 addition & 1 deletion playbooks/config/set-ca-renewal-master-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
gather_facts: no

tasks:
- name: set ca_renewal_master_server
- name: Set ca_renewal_master_server
ipaconfig:
ipaadmin_password: SomeADMINpassword
ca_renewal_master_server: carenewal.example.com
2 changes: 1 addition & 1 deletion playbooks/dnszone/dnszone-all-params.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: dnszone present
- name: All dnszone parameters
hosts: ipaserver
become: true

Expand Down
2 changes: 1 addition & 1 deletion playbooks/dnszone/dnszone-present.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: dnszone present
- name: Dnszone present
hosts: ipaserver
become: true

Expand Down
2 changes: 1 addition & 1 deletion playbooks/trust/add-trust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
become: true

tasks:
- name: ensure the trust is present
- name: Ensure the trust is present
ipatrust:
ipaadmin_password: SomeADMINpassword
realm: windows.local
Expand Down
2 changes: 1 addition & 1 deletion playbooks/trust/del-trust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
become: true

tasks:
- name: ensure the trust is absent
- name: Ensure the trust is absent
ipatrust:
ipaadmin_password: SomeADMINpassword
realm: windows.local
Expand Down
2 changes: 1 addition & 1 deletion tests/automember/test_automember_orphans_removed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- name: Get Domain from server name
ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] |
join ('.') }}"
join('.') }}"
when: ipaserver_domain is not defined

# CLEANUP TEST ITEMS
Expand Down
2 changes: 1 addition & 1 deletion tests/automember/test_automember_rebuilt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- name: Get Domain from server name
ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] |
join ('.') }}"
join('.') }}"
when: ipaserver_domain is not defined

# CLEANUP TEST ITEMS
Expand Down
32 changes: 16 additions & 16 deletions tests/automount/test_automountkey.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@
gather_facts: no

tasks:
- name: ensure test location TestLocation is present
- name: Ensure test location TestLocation is present
ipaautomountlocation:
ipaadmin_password: SomeADMINpassword
name: TestLocation

- name: ensure test map TestMap is present
- name: Ensure test map TestMap is present
ipaautomountmap:
ipaadmin_password: SomeADMINpassword
name: TestMap
location: TestLocation

- name: ensure key NewKeyName is absent
- name: Ensure key NewKeyName is absent
ipaautomountkey:
ipaadmin_password: SomeADMINpassword
location: TestLocation
map: TestMap
key: NewKeyName
state: absent

- name: ensure key TestKey is absent
- name: Ensure key TestKey is absent
ipaautomountkey:
ipaadmin_password: SomeADMINpassword
location: TestLocation
Expand All @@ -35,7 +35,7 @@
- name: Execute Automount Key tests
block:
### test the key creation, and modification
- name: ensure key TestKey is present
- name: Ensure key TestKey is present
ipaautomountkey:
ipaadmin_password: SomeADMINpassword
location: TestLocation
Expand All @@ -46,7 +46,7 @@
register: result
failed_when: result.failed or not result.changed

- name: ensure key TestKey is present again
- name: Ensure key TestKey is present again
ipaautomountkey:
ipaadmin_password: SomeADMINpassword
location: TestLocation
Expand All @@ -58,7 +58,7 @@
failed_when: result.failed or result.changed

## modify the key
- name: ensure key TestKey information has been updated
- name: Ensure key TestKey information has been updated
ipaautomountkey:
ipaadmin_password: SomeADMINpassword
location: TestLocation
Expand All @@ -69,7 +69,7 @@
register: result
failed_when: result.failed or not result.changed

- name: ensure key TestKey information has been updated again
- name: Ensure key TestKey information has been updated again
ipaautomountkey:
ipaadmin_password: SomeADMINpassword
location: TestLocation
Expand All @@ -81,7 +81,7 @@
failed_when: result.failed or result.changed

## modify the name
- name: ensure key TestKey has been renamed to NewKeyName
- name: Ensure key TestKey has been renamed to NewKeyName
ipaautomountkey:
ipaadmin_password: SomeADMINpassword
location: TestLocation
Expand All @@ -92,7 +92,7 @@
register: result
failed_when: result.failed or not result.changed

- name: ensure key TestKey is absent
- name: Ensure key TestKey is absent
ipaautomountkey:
ipaadmin_password: SomeADMINpassword
location: TestLocation
Expand All @@ -102,7 +102,7 @@
register: result
failed_when: result.failed or result.changed

- name: ensure key NewKeyName is present
- name: Ensure key NewKeyName is present
ipaautomountkey:
ipaadmin_password: SomeADMINpassword
location: TestLocation
Expand All @@ -113,7 +113,7 @@
register: result
failed_when: result.failed or result.changed

- name: ensure failure when state is renamed and newname is not set
- name: Ensure failure when state is renamed and newname is not set
ipaautomountkey:
ipaadmin_password: SomeADMINpassword
location: TestLocation
Expand All @@ -125,30 +125,30 @@

### cleanup after the tests
always:
- name: ensure key NewKeyName is absent
- name: Ensure key NewKeyName is absent
ipaautomountkey:
ipaadmin_password: SomeADMINpassword
location: TestLocation
map: TestMap
key: NewKeyName
state: absent

- name: ensure key TestKey is absent
- name: Ensure key TestKey is absent
ipaautomountkey:
ipaadmin_password: SomeADMINpassword
location: TestLocation
map: TestMap
key: NewKeyName
state: absent

- name: ensure map TestMap is absent
- name: Ensure map TestMap is absent
ipaautomountmap:
ipaadmin_password: SomeADMINpassword
name: TestMap
location: TestLocation
state: absent

- name: ensure location TestLocation is absent
- name: Ensure location TestLocation is absent
ipaautomountlocation:
ipaadmin_password: SomeADMINpassword
name: TestLocation
Expand Down
22 changes: 11 additions & 11 deletions tests/automount/test_automountlocation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
gather_facts: false

tasks:
- name: ensure automountlocation TestLocations are absent before testing
- name: Ensure automountlocation TestLocations are absent before testing
ipaautomountlocation:
ipaadmin_password: SomeADMINpassword
ipaapi_context: "{{ ipa_context | default(omit) }}"
Expand All @@ -14,7 +14,7 @@
- TestLocation_02
state: absent

- name: ensure empty automountlocation does nothing
- name: Ensure empty automountlocation does nothing
ipaautomountlocation:
ipaadmin_password: SomeADMINpassword
ipaapi_context: "{{ ipa_context | default(omit) }}"
Expand All @@ -23,7 +23,7 @@
register: result
failed_when: not result.failed or "At least one location must be provided" not in result.msg

- name: ensure empty automountlocation does nothing on absent
- name: Ensure empty automountlocation does nothing on absent
ipaautomountlocation:
ipaadmin_password: SomeADMINpassword
ipaapi_context: "{{ ipa_context | default(omit) }}"
Expand All @@ -32,7 +32,7 @@
register: result
failed_when: not result.failed or "At least one location must be provided" not in result.msg

- name: ensure automountlocation TestLocation is present
- name: Ensure automountlocation TestLocation is present
ipaautomountlocation:
ipaadmin_password: SomeADMINpassword
ipaapi_context: "{{ ipa_context | default(omit) }}"
Expand All @@ -41,7 +41,7 @@
register: result
failed_when: not result.changed or result.failed

- name: ensure automountlocation TestLocation is present again
- name: Ensure automountlocation TestLocation is present again
ipaautomountlocation:
ipaadmin_password: SomeADMINpassword
ipaapi_context: "{{ ipa_context | default(omit) }}"
Expand All @@ -50,7 +50,7 @@
register: result
failed_when: result.changed or result.failed

- name: ensure automountlocation TestLocation is absent
- name: Ensure automountlocation TestLocation is absent
ipaautomountlocation:
ipaadmin_password: SomeADMINpassword
ipaapi_context: "{{ ipa_context | default(omit) }}"
Expand All @@ -59,7 +59,7 @@
register: result
failed_when: not result.changed or result.failed

- name: ensure automountlocation TestLocation is absent again
- name: Ensure automountlocation TestLocation is absent again
ipaautomountlocation:
ipaadmin_password: SomeADMINpassword
ipaapi_context: "{{ ipa_context | default(omit) }}"
Expand All @@ -68,7 +68,7 @@
register: result
failed_when: result.changed or result.failed

- name: ensure a list of automountlocations are present
- name: Ensure a list of automountlocations are present
ipaautomountlocation:
ipaadmin_password: SomeADMINpassword
ipaapi_context: "{{ ipa_context | default(omit) }}"
Expand All @@ -79,7 +79,7 @@
register: result
failed_when: result.failed or not result.changed

- name: ensure a list of automountlocations exist
- name: Ensure a list of automountlocations exist
ipaautomountlocation:
ipaadmin_password: SomeADMINpassword
ipaapi_context: "{{ ipa_context | default(omit) }}"
Expand All @@ -90,7 +90,7 @@
register: result
failed_when: result.changed or result.failed

- name: ensure a list of automountlocations are absent
- name: Ensure a list of automountlocations are absent
ipaautomountlocation:
ipaadmin_password: SomeADMINpassword
ipaapi_context: "{{ ipa_context | default(omit) }}"
Expand All @@ -101,7 +101,7 @@
register: result
failed_when: result.failed or not result.changed

- name: ensure multiple automountlocations are absent
- name: Ensure multiple automountlocations are absent
ipaautomountlocation:
ipaadmin_password: SomeADMINpassword
ipaapi_context: "{{ ipa_context | default(omit) }}"
Expand Down
Loading

0 comments on commit 308d970

Please sign in to comment.