[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
This commit is contained in:
egarette@silique.fr 2023-12-18 11:34:35 +01:00
parent ff4fe65d8f
commit a7a2d7150a
4 changed files with 22 additions and 0 deletions

View file

@ -13,3 +13,6 @@
- name: Display variable env_srep_all.apero_password - name: Display variable env_srep_all.apero_password
ansible.builtin.debug: ansible.builtin.debug:
var: env_srep_all.apero_password var: env_srep_all.apero_password
- name: Display variable env_nfs_all.configure
ansible.builtin.debug:
var: env_nfs_all.configure

8
Ansible/asserts/nfs.yml Normal file
View file

@ -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

View file

@ -0,0 +1,3 @@
---
env_nfs_all:
configure: "{{ env_nfs.configure | default(false) }}"

8
doc.md
View file

@ -46,6 +46,12 @@ This family is a leadership.
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **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 | | **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 |
## NFS configuration (env_nfs)
| Parameter | Comment |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **configure**<br/>`mandatory`<br/>**Type:** [`boolean`](https://forge.cloud.silique.fr/stove/rougail/src/branch/main/doc/variable/README.md#le-type-de-la-variable) | Configure NFS mount.<br/>To share documents between differents services, you need to configure a NFS server .<br/>**Default:** False |
# Example with mandatories variables # Example with mandatories variables
``` ```
@ -80,4 +86,6 @@ env_srep:
apero_user: srep apero_user: srep
env_omogen: env_omogen:
keystore: java.jks keystore: java.jks
env_nfs:
configure: false
``` ```