Add Traits Module

Change-Id: I7db759f716c1154cb0dd30e240af3a0420efab8f
Signed-off-by: Freerk-Ole Zakfeld <fzakfeld@scaleuptech.com>
This commit is contained in:
Freerk-Ole Zakfeld
2025-01-13 16:35:18 +01:00
parent 5dbf47cb49
commit f9fcd35018
4 changed files with 135 additions and 0 deletions

View File

@@ -0,0 +1 @@
trait_name: CUSTOM_ANSIBLE_TRAIT

View File

@@ -0,0 +1,23 @@
---
- openstack.cloud.trait:
cloud: "{{ cloud }}"
state: present
id: "{{ trait_name }}"
delegate_to: localhost
register: item
- assert:
that:
- "'name' in item.trait"
- "item.trait.id == trait_name"
- openstack.cloud.trait:
cloud: "{{ cloud }}"
state: absent
id: "{{ trait_name }}"
delegate_to: localhost
register: item
- assert:
that:
- "'trait' not in item"