rougail-output-ansible/tests/results-doc/test_namespace_mandatory/40_9leadership-calculation-variable.sh

123 lines
19 KiB
Bash
Raw Normal View History

2026-05-04 12:17:56 +02:00
rougail.rougail - Rougail
2026-01-14 14:25:35 +01:00
2026-05-04 12:17:56 +02:00
This repository contains the  rougail.rougail  Ansible Collection.
2026-01-14 14:25:35 +01:00
2026-05-04 12:17:56 +02:00
This family is a namespace
2026-01-14 14:25:35 +01:00
2026-05-04 12:17:56 +02:00
Variables
The group variable "rougail" - Rougail
▌ 🛈 Informations
▌ 
▌  standard 
2026-01-14 14:25:35 +01:00
2026-02-21 21:31:34 +01:00
┏━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
 ┃ ┃ Default  ┃ ┃ Access  ┃ ┃
 Variable  ┃ Descripti… ┃ value  ┃ Type  ┃ control  ┃ Validator  ┃
┡━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
calculate │ A │ • value1 │  string    │  standard  │  unique  │
│ │ calculated │ • value2 │ multiple  │ │ │
│ │ variable. │ │ mandatory  │ │ │
└────────────┴────────────┴────────────┴────────────┴─────────────┴────────────┘
2026-01-14 14:25:35 +01:00
2026-05-04 12:17:56 +02:00
A leadership
▌ 🛈 Informations
▌ 
▌ This family contains lists of variable blocks.
▌ Path: leader
▌  standard 
2026-01-14 14:25:35 +01:00
2026-02-21 21:31:34 +01:00
┏━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
 ┃ ┃ Default  ┃ ┃ Access  ┃ ┃
 Variable  ┃ Descripti… ┃ value  ┃ Type  ┃ control  ┃ Validator  ┃
┡━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
leader.le… │ A leader. │ the value │  string    │  standard  │  unique  │
│ │ │ of the │ multiple  │ │ │
│ │ │ variable │ mandatory  │ │ │
2026-05-04 12:17:56 +02:00
│ │ │ "a │ │ │ │
│ │ │ calculated │ │ │ │
│ │ │ variable" │ │ │ │
│ │ │ (calculat… │ │ │ │
2026-02-21 21:31:34 +01:00
├────────────┼────────────┼────────────┼────────────┼─────────────┼────────────┤
leader.fo… │ A │ val11 │  string    │  standard  │ │
│ │ follower. │ │ mandatory  │ │ │
├────────────┼────────────┼────────────┼────────────┼─────────────┼────────────┤
leader.fo… │ An other │ val21 │  string    │  standard  │ │
│ │ follower. │ │ mandatory  │ │ │
└────────────┴────────────┴────────────┴────────────┴─────────────┴────────────┘
2026-01-14 14:25:35 +01:00
2026-05-04 12:17:56 +02:00
Usage
2026-01-14 14:25:35 +01:00
2026-05-04 12:17:56 +02:00
Example playbook with Rougail
2026-01-21 08:55:24 +01:00
Add to your structural file something like:
2026-05-04 12:17:56 +02:00
%YAML 1.2 
2026-02-21 21:31:34 +01:00
--- 
2026-05-04 12:17:56 +02:00
version: 1.1 
my_rougail: 
 type: rougail 
... 
▌ 🛈 Informations
▌ 
▌ Do not forget to add Rougail structural file as Rougail types.
2026-01-21 08:55:24 +01:00
2026-05-04 12:17:56 +02:00
For example you can add an YAML user data with something like:
2026-01-21 08:55:24 +01:00
2026-05-04 12:17:56 +02:00
--- 
my_rougail: 
 calculate: # A calculated variable 
 - string1 
 - string2 
 - string3 
 leader: # A leadership 
 - leader: string1 # A leader 
 follower1: string1 # A follower 
 follower2: string1 # An other follower 
 - leader: string2 # A leader 
 follower1: string2 # A follower 
 follower2: string2 # An other follower 
 - leader: string3 # A leader 
 follower1: string3 # A follower 
 follower2: string3 # An other follower 
Add to your play:
2026-01-21 08:55:24 +01:00
2026-02-21 21:31:34 +01:00
--- 
- name: Rougail 
2026-05-04 12:17:56 +02:00
 hosts: servers 
 vars: 
 rougail: '{{ my_rougail }}' 
 ansible.builtin.import_playbook: rougail.rougail.install 
2026-01-21 08:55:24 +01:00
2026-05-04 12:17:56 +02:00
Example playbook without Rougail
▌ 🛈 Informations
▌ 
▌ The variables will not be properly validated without Rougail.
2026-01-14 14:25:35 +01:00
2026-02-21 21:31:34 +01:00
--- 
- name: Rougail 
2026-05-04 12:17:56 +02:00
 hosts: servers 
 vars: 
 rougail: 
 calculate: # A calculated variable 
 - string1 
 - string2 
 - string3 
 leader: # A leadership 
 - leader: string1 # A leader 
 follower1: string1 # A follower 
 follower2: string1 # An other follower 
 - leader: string2 # A leader 
 follower1: string2 # A follower 
 follower2: string2 # An other follower 
 - leader: string3 # A leader 
 follower1: string3 # A follower 
 follower2: string3 # An other follower 
 ansible.builtin.import_playbook: rougail.rougail.install