From a7a2d7150a6dfeb7d43af27818a4b2a61e608963 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Mon, 18 Dec 2023 11:34:35 +0100 Subject: [PATCH] [tutorial Ansible 4.0] a boolean variable NFS configuration ================= Need could be activated. In this case, we need to add server domain name --- env_nfs: configure: true --- Ansible/asserts/display.yml | 3 +++ Ansible/asserts/nfs.yml | 8 ++++++++ Ansible/inventory/group_vars/all/nfs.yml | 3 +++ doc.md | 8 ++++++++ 4 files changed, 22 insertions(+) create mode 100644 Ansible/asserts/nfs.yml create mode 100644 Ansible/inventory/group_vars/all/nfs.yml diff --git a/Ansible/asserts/display.yml b/Ansible/asserts/display.yml index 8f5bea2..2b4c64c 100644 --- a/Ansible/asserts/display.yml +++ b/Ansible/asserts/display.yml @@ -13,3 +13,6 @@ - name: Display variable env_srep_all.apero_password ansible.builtin.debug: var: env_srep_all.apero_password +- name: Display variable env_nfs_all.configure + ansible.builtin.debug: + var: env_nfs_all.configure diff --git a/Ansible/asserts/nfs.yml b/Ansible/asserts/nfs.yml new file mode 100644 index 0000000..b051e71 --- /dev/null +++ b/Ansible/asserts/nfs.yml @@ -0,0 +1,8 @@ +- name: NFS | Assert variables | test env_nfs_all + ansible.builtin.assert: + that: + - env_nfs_all is defined + - env_nfs_all.configure is defined + - env_nfs_all.configure is boolean + fail_msg: + - Please configure your NFS manually diff --git a/Ansible/inventory/group_vars/all/nfs.yml b/Ansible/inventory/group_vars/all/nfs.yml new file mode 100644 index 0000000..5b339e6 --- /dev/null +++ b/Ansible/inventory/group_vars/all/nfs.yml @@ -0,0 +1,3 @@ +--- +env_nfs_all: + configure: "{{ env_nfs.configure | default(false) }}" diff --git a/doc.md b/doc.md index f66fec1..1a6db36 100644 --- a/doc.md +++ b/doc.md @@ -46,6 +46,12 @@ This family is a leadership. |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | **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 | +## NFS configuration (env_nfs) + +| Parameter | Comment | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **configure**
`mandatory`
**Type:** [`boolean`](https://forge.cloud.silique.fr/stove/rougail/src/branch/main/doc/variable/README.md#le-type-de-la-variable) | Configure NFS mount.
To share documents between differents services, you need to configure a NFS server .
**Default:** False | + # Example with mandatories variables ``` @@ -80,4 +86,6 @@ env_srep: apero_user: srep env_omogen: keystore: java.jks +env_nfs: + configure: false ```