mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-28 10:24:47 +00:00
Adding an option to create multiple services in one go. Adding tests (present/absent/without_skip_host_check) Copied from PR #1054 Signed-off-by: Denis Karpelevich <dkarpele@redhat.com>
33 lines
829 B
YAML
33 lines
829 B
YAML
---
|
|
- 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: Services absent len:{{ service_list | length }}
|
|
ipaservice:
|
|
ipaadmin_password: SomeADMINpassword
|
|
services: "{{ services_names }}"
|
|
state: absent
|
|
|
|
- name: Remove services.json
|
|
hosts: localhost
|
|
tasks:
|
|
- name: Remove services.json
|
|
ansible.builtin.file:
|
|
state: absent
|
|
path: services.json
|