[tutorial Ansible 3.0] a validator

OMOGEN configuration
====================

Ask the keystore filename. This file must has jks extension.

---
env_omogen:
  keystore: filename.jks

Examples of Ops inventory file
==============================

1/ INVALID:

---
env_omogen:
  keystore: filename.txt
This commit is contained in:
egarette@silique.fr 2023-12-18 11:34:34 +01:00
parent 15f450a5ab
commit 44b6db71ae
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,9 @@
---
- name: Test variable env_omogen
ansible.builtin.assert:
that:
- env_omogen is defined
- env_omogen.keystore is defined
- env_omogen.keystore is string
- env_omogen.keystore.endswith('.jks')
fail_msg: "env_omogen.keystore n'existe pas ou est de mauvais type !"

10
doc.md
View file

@ -40,6 +40,12 @@ This family is a leadership.
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **apero_user**<br/>`mandatory`<br/>**Type:** [`choice`](https://forge.cloud.silique.fr/stove/rougail/src/branch/main/doc/variable/README.md#le-type-de-la-variable) | Account to access to Apero service.<br/>**Choices:** see variable "env_apero.access.login"<br/>**Example:** srep |
## Configure OMOGEN (env_omogen)
| Parameter | Comment |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **keystore**<br/>`mandatory`<br/>**Type:** [`string`](https://forge.cloud.silique.fr/stove/rougail/src/branch/main/doc/variable/README.md#le-type-de-la-variable) | Keystore filename to access to OMOGEN.<br/>This filename must ends with "kjs" extension.<br/>**Example:** java.jks |
# Example with mandatories variables
```
@ -51,6 +57,8 @@ env_apero:
password: xxx
env_srep:
apero_user: srep
env_omogen:
keystore: java.jks
```
# Example with all variables
@ -70,4 +78,6 @@ env_apero:
password: xxx
env_srep:
apero_user: srep
env_omogen:
keystore: java.jks
```