ipaservice: Updated and new tests for certificates and multi service handling

The tests test_services_absent.yml, test_services_present.yml and
test_services_present_slice.yml have been updated to use in memory data
for testing instead of loading json files. This made is simpler to use
variables from the playbook for example for fqdn host names.

New tests for certificates with and without trailing new lines have been
added for single service and multiple service handling.
This commit is contained in:
Thomas Woerner
2023-06-06 13:00:26 +02:00
parent 872c9e4cb2
commit 09250cb2c5
10 changed files with 735 additions and 156 deletions

View File

@@ -1,32 +1,15 @@
---
- name: Include create_services_json.yml
ansible.builtin.import_playbook: create_services_json.yml
- name: Test services absent
hosts: ipaserver
become: true
gather_facts: false
tasks:
- name: Include services.json
ansible.builtin.include_vars:
file: services.json # noqa 505
- name: Create dict with service names
ansible.builtin.set_fact:
services_names: "{{ services_names | default([]) + [{'name': item.name}] }}"
loop: "{{ service_list }}"
- name: Include generate_test_data.yml
ansible.builtin.include_tasks: generate_test_data.yml
- name: Services absent len:{{ service_list | length }}
ipaservice:
ipaadmin_password: SomeADMINpassword
services: "{{ services_names }}"
services: "{{ service_absent_list }}"
state: absent
- name: Remove services.json
hosts: localhost
tasks:
- name: Remove services.json
ansible.builtin.file:
state: absent
path: services.json