From 44b6db71aee2bdf3f6b7f2f5d8257708a7193bfa Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Mon, 18 Dec 2023 11:34:34 +0100 Subject: [PATCH] [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 --- Ansible/asserts/omogen.yml | 9 +++++++++ doc.md | 10 ++++++++++ 2 files changed, 19 insertions(+) create mode 100644 Ansible/asserts/omogen.yml diff --git a/Ansible/asserts/omogen.yml b/Ansible/asserts/omogen.yml new file mode 100644 index 0000000..7bec333 --- /dev/null +++ b/Ansible/asserts/omogen.yml @@ -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 !" diff --git a/doc.md b/doc.md index a5628cf..f66fec1 100644 --- a/doc.md +++ b/doc.md @@ -40,6 +40,12 @@ This family is a leadership. |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | **apero_user**
`mandatory`
**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.
**Choices:** see variable "env_apero.access.login"
**Example:** srep | +## Configure OMOGEN (env_omogen) + +| Parameter | Comment | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **keystore**
`mandatory`
**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.
This filename must ends with "kjs" extension.
**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 ```