fix: prepare ansible user data

This commit is contained in:
egarette@silique.fr 2024-11-25 10:13:58 +01:00
parent c27c917b71
commit 46db478687
318 changed files with 2002 additions and 279 deletions

View file

@ -1,2 +1,2 @@
# rougail-user-data
# rougail-user-data-file

View file

@ -41,7 +41,6 @@ class RougailUserDataFile:
raise Exception(_("file is not set in step.user_data"))
self.rougailconfig = rougailconfig
self.filenames = self.rougailconfig["file.filename"]
self.yaml = YAML()
self.config = config
self.errors = []
self.warnings = []
@ -49,26 +48,26 @@ class RougailUserDataFile:
def run(
self,
) -> None:
self.yaml = YAML()
user_datas = []
for filename in self.filenames:
with open(filename) as fh_config:
file_values = self.yaml.load(fh_config)
file_values = self.open(filename)
if not file_values:
continue
values = {}
if not isinstance(file_values, dict):
self.errors.append(
_(
'cannot load "{0}", the root value is not a dict but "{1}"'
).format(filename, file_values)
)
continue
values = {}
self.parse(
values,
"",
file_values,
filename,
)
else:
self.parse(
values,
"",
file_values,
filename,
)
user_datas.append(
{
"source": _("file ({0})").format(filename),
@ -79,6 +78,10 @@ class RougailUserDataFile:
)
return user_datas
def open(self, filename: str) -> dict:
with open(filename) as fh_config:
return self.yaml.load(fh_config)
def parse(
self,
values: dict,

View file

@ -33,7 +33,7 @@ file:
disabled
{% endif %}
filename:
description: Filename with user data
description: Filename
alternative_name: ff
type: unix_filename
multi: true

View file

@ -4,3 +4,6 @@ rougail:
var3: test1
var4:
var5: false
var6:
- test1
- test2

View file

@ -4,3 +4,6 @@ rougail:
var3: test1
var4:
var5: false
var6:
- test1
- test2

View file

@ -1,3 +1,6 @@
rougail:
var1: test
var3: test1
var6:
- test1
- test2

View file

@ -3,5 +3,9 @@
"rougail.var2": "test",
"rougail.var3": "test1",
"rougail.var4": null,
"rougail.var5": false
"rougail.var5": false,
"rougail.var6": [
"test1",
"test2"
]
}

View file

@ -3,5 +3,9 @@
"rougail.var2": "value",
"rougail.var3": "test1",
"rougail.var4": null,
"rougail.var5": true
"rougail.var5": true,
"rougail.var6": [
"test1",
"test2"
]
}

View file

@ -1 +1,5 @@
{}
rougail:
var1:
- string1
- string2
- string3

View file

@ -1,6 +1,7 @@
{
"rougail.var1": [
"value",
"None"
"string1",
"string2",
"string3"
]
}

View file

@ -1,2 +1 @@
rougail:
int: 1
{}

View file

@ -1,3 +1,3 @@
{
"rougail.int": 1
"rougail.int": 10
}

View file

@ -0,0 +1,6 @@
{
"errors": [
"cannot access to option \"rougail.var2\" (a second variable) because has property \"disabled\""
],
"warnings": []
}

View file

@ -0,0 +1,4 @@
rougail:
var1: string1
var2: string1
var3: string1

View file

@ -0,0 +1,4 @@
rougail:
var1: string1
var2: string1
var3: string1

View file

@ -0,0 +1,2 @@
rougail:
var2: string1

View file

@ -0,0 +1,5 @@
{
"rougail.var1": "string1",
"rougail.var2": "string1",
"rougail.var3": "string1"
}

View file

@ -0,0 +1,4 @@
{
"rougail.var1": "value",
"rougail.var3": "value"
}

View file

@ -0,0 +1,6 @@
{
"errors": [
"cannot access to option \"rougail.var2\" (a second variable) because has property \"disabled\""
],
"warnings": []
}

View file

@ -0,0 +1,4 @@
rougail:
var1: string1
var2: string1
var3: string1

View file

@ -0,0 +1,4 @@
rougail:
var1: string1
var2: string1
var3: string1

View file

@ -0,0 +1,3 @@
rougail:
var2: string1
var3: string1

View file

@ -0,0 +1,5 @@
{
"rougail.var1": "string1",
"rougail.var2": "string1",
"rougail.var3": "string1"
}

View file

@ -0,0 +1,4 @@
{
"rougail.var1": "value",
"rougail.var3": "string1"
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -1,4 +1,6 @@
{
"errors": [],
"errors": [
"cannot access to optiondescription \"rougail.family\" because has property \"disabled\""
],
"warnings": []
}

View file

@ -1 +1,3 @@
{}
rougail:
family:
var2: string1

View file

@ -4,8 +4,8 @@ rougail:
follower1: string1
follower2: string1
- leader: string2
follower1: string1
follower2: string1
follower1: string2
follower2: string2
- leader: string3
follower1: string1
follower2: string1
follower1: string3
follower2: string3

View file

@ -4,8 +4,8 @@ rougail:
follower1: string1
follower2: string1
- leader: string2
follower1: string1
follower2: string1
follower1: string2
follower2: string2
- leader: string3
follower1: string1
follower2: string1
follower1: string3
follower2: string3

View file

@ -4,8 +4,8 @@ rougail:
follower1: string1
follower2: string1
- leader: string2
follower1: string1
follower2: string1
follower1: string2
follower2: string2
- leader: string3
follower1: string1
follower2: string1
follower1: string3
follower2: string3

View file

@ -7,13 +7,13 @@
},
{
"rougail.leader.leader": "string2",
"rougail.leader.follower1": "string1",
"rougail.leader.follower2": "string1"
"rougail.leader.follower1": "string2",
"rougail.leader.follower2": "string2"
},
{
"rougail.leader.leader": "string3",
"rougail.leader.follower1": "string1",
"rougail.leader.follower2": "string1"
"rougail.leader.follower1": "string3",
"rougail.leader.follower2": "string3"
}
]
}

View file

@ -7,13 +7,13 @@
},
{
"rougail.leader.leader": "string2",
"rougail.leader.follower1": "string1",
"rougail.leader.follower2": "string1"
"rougail.leader.follower1": "string2",
"rougail.leader.follower2": "string2"
},
{
"rougail.leader.leader": "string3",
"rougail.leader.follower1": "string1",
"rougail.leader.follower2": "string1"
"rougail.leader.follower1": "string3",
"rougail.leader.follower2": "string3"
}
]
}

View file

@ -4,8 +4,8 @@ rougail:
follower1: string1
follower2: string1
- leader: string2
follower1: string1
follower2: string1
follower1: string2
follower2: string2
- leader: string3
follower1: string1
follower2: string1
follower1: string3
follower2: string3

View file

@ -4,8 +4,8 @@ rougail:
follower1: string1
follower2: string1
- leader: string2
follower1: string1
follower2: string1
follower1: string2
follower2: string2
- leader: string3
follower1: string1
follower2: string1
follower1: string3
follower2: string3

View file

@ -4,8 +4,8 @@ rougail:
follower1: string1
follower2: string1
- leader: string2
follower1: string1
follower2: string1
follower1: string2
follower2: string2
- leader: string3
follower1: string1
follower2: string1
follower1: string3
follower2: string3

View file

@ -7,13 +7,13 @@
},
{
"rougail.leadership.leader": "string2",
"rougail.leadership.follower1": "string1",
"rougail.leadership.follower2": "string1"
"rougail.leadership.follower1": "string2",
"rougail.leadership.follower2": "string2"
},
{
"rougail.leadership.leader": "string3",
"rougail.leadership.follower1": "string1",
"rougail.leadership.follower2": "string1"
"rougail.leadership.follower1": "string3",
"rougail.leadership.follower2": "string3"
}
]
}

View file

@ -7,13 +7,13 @@
},
{
"rougail.leadership.leader": "string2",
"rougail.leadership.follower1": "string1",
"rougail.leadership.follower2": "string1"
"rougail.leadership.follower1": "string2",
"rougail.leadership.follower2": "string2"
},
{
"rougail.leadership.leader": "string3",
"rougail.leadership.follower1": "string1",
"rougail.leadership.follower2": "string1"
"rougail.leadership.follower1": "string3",
"rougail.leadership.follower2": "string3"
}
]
}

View file

@ -4,8 +4,8 @@ rougail:
follower1: string1
follower2: string1
- leader: string2
follower1: string1
follower2: string1
follower1: string2
follower2: string2
- leader: string3
follower1: string1
follower2: string1
follower1: string3
follower2: string3

View file

@ -4,8 +4,8 @@ rougail:
follower1: string1
follower2: string1
- leader: string2
follower1: string1
follower2: string1
follower1: string2
follower2: string2
- leader: string3
follower1: string1
follower2: string1
follower1: string3
follower2: string3

View file

@ -7,13 +7,13 @@
},
{
"rougail.leader.leader": "string2",
"rougail.leader.follower1": "string1",
"rougail.leader.follower2": "string1"
"rougail.leader.follower1": "string2",
"rougail.leader.follower2": "string2"
},
{
"rougail.leader.leader": "string3",
"rougail.leader.follower1": "string1",
"rougail.leader.follower2": "string1"
"rougail.leader.follower1": "string3",
"rougail.leader.follower2": "string3"
}
]
}

View file

@ -3,6 +3,6 @@ rougail:
- leader: string1
follower1: string1
- leader: string2
follower1: string1
follower1: string2
- leader: string3
follower1: string1
follower1: string3

View file

@ -3,6 +3,6 @@ rougail:
- leader: string1
follower1: string1
- leader: string2
follower1: string1
follower1: string2
- leader: string3
follower1: string1
follower1: string3

View file

@ -6,11 +6,11 @@
},
{
"rougail.leader.leader": "string2",
"rougail.leader.follower1": "string1"
"rougail.leader.follower1": "string2"
},
{
"rougail.leader.leader": "string3",
"rougail.leader.follower1": "string1"
"rougail.leader.follower1": "string3"
}
]
}

View file

@ -7,8 +7,8 @@ rougail:
follower1: string1
follower2: string1
- leader: string2
follower1: string1
follower2: string1
follower1: string2
follower2: string2
- leader: string3
follower1: string1
follower2: string1
follower1: string3
follower2: string3

View file

@ -7,8 +7,8 @@ rougail:
follower1: string1
follower2: string1
- leader: string2
follower1: string1
follower2: string1
follower1: string2
follower2: string2
- leader: string3
follower1: string1
follower2: string1
follower1: string3
follower2: string3

View file

@ -5,8 +5,8 @@ rougail:
follower1: string1
follower2: string1
- leader: string2
follower1: string1
follower2: string1
follower1: string2
follower2: string2
- leader: string3
follower1: string1
follower2: string1
follower1: string3
follower2: string3

View file

@ -8,13 +8,13 @@
},
{
"rougail.general1.leader.leader": "string2",
"rougail.general1.leader.follower1": "string1",
"rougail.general1.leader.follower2": "string1"
"rougail.general1.leader.follower1": "string2",
"rougail.general1.leader.follower2": "string2"
},
{
"rougail.general1.leader.leader": "string3",
"rougail.general1.leader.follower1": "string1",
"rougail.general1.leader.follower2": "string1"
"rougail.general1.leader.follower1": "string3",
"rougail.general1.leader.follower2": "string3"
}
]
}

View file

@ -8,13 +8,13 @@
},
{
"rougail.general1.leader.leader": "string2",
"rougail.general1.leader.follower1": "string1",
"rougail.general1.leader.follower2": "string1"
"rougail.general1.leader.follower1": "string2",
"rougail.general1.leader.follower2": "string2"
},
{
"rougail.general1.leader.leader": "string3",
"rougail.general1.leader.follower1": "string1",
"rougail.general1.leader.follower2": "string1"
"rougail.general1.leader.follower1": "string3",
"rougail.general1.leader.follower2": "string3"
}
]
}

View file

@ -5,10 +5,10 @@ rougail:
follower2: string1
follower3: string1
- leader: string2
follower1: string1
follower2: string1
follower3: string1
follower1: string2
follower2: string2
follower3: string2
- leader: string3
follower1: string1
follower2: string1
follower3: string1
follower1: string3
follower2: string3
follower3: string3

View file

@ -5,10 +5,10 @@ rougail:
follower2: string1
follower3: string1
- leader: string2
follower1: string1
follower2: string1
follower3: string1
follower1: string2
follower2: string2
follower3: string2
- leader: string3
follower1: string1
follower2: string1
follower3: string1
follower1: string3
follower2: string3
follower3: string3

View file

@ -5,10 +5,10 @@ rougail:
follower2: string1
follower3: string1
- leader: string2
follower1: string1
follower2: string1
follower3: string1
follower1: string2
follower2: string2
follower3: string2
- leader: string3
follower1: string1
follower2: string1
follower3: string1
follower1: string3
follower2: string3
follower3: string3

View file

@ -8,15 +8,15 @@
},
{
"rougail.leader.leader": "string2",
"rougail.leader.follower1": "string1",
"rougail.leader.follower2": "string1",
"rougail.leader.follower3": "string1"
"rougail.leader.follower1": "string2",
"rougail.leader.follower2": "string2",
"rougail.leader.follower3": "string2"
},
{
"rougail.leader.leader": "string3",
"rougail.leader.follower1": "string1",
"rougail.leader.follower2": "string1",
"rougail.leader.follower3": "string1"
"rougail.leader.follower1": "string3",
"rougail.leader.follower2": "string3",
"rougail.leader.follower3": "string3"
}
]
}

View file

@ -8,15 +8,15 @@
},
{
"rougail.leader.leader": "string2",
"rougail.leader.follower1": "string1",
"rougail.leader.follower2": "string1",
"rougail.leader.follower3": "string1"
"rougail.leader.follower1": "string2",
"rougail.leader.follower2": "string2",
"rougail.leader.follower3": "string2"
},
{
"rougail.leader.leader": "string3",
"rougail.leader.follower1": "string1",
"rougail.leader.follower2": "string1",
"rougail.leader.follower3": "string1"
"rougail.leader.follower1": "string3",
"rougail.leader.follower2": "string3",
"rougail.leader.follower3": "string3"
}
]
}

View file

@ -3,6 +3,6 @@ rougail:
- leader: string1
follower1: 1
- leader: string2
follower1: 1
follower1: 2
- leader: string3
follower1: 1
follower1: 3

View file

@ -3,6 +3,6 @@ rougail:
- leader: string1
follower1: 1
- leader: string2
follower1: 1
follower1: 2
- leader: string3
follower1: 1
follower1: 3

View file

@ -6,11 +6,11 @@
},
{
"rougail.leader.leader": "string2",
"rougail.leader.follower1": 1
"rougail.leader.follower1": 2
},
{
"rougail.leader.leader": "string3",
"rougail.leader.follower1": 1
"rougail.leader.follower1": 3
}
]
}

View file

@ -3,6 +3,6 @@ rougail:
- leader: string1
follower1: 1
- leader: string2
follower1: 1
follower1: 2
- leader: string3
follower1: 1
follower1: 3

View file

@ -3,6 +3,6 @@ rougail:
- leader: string1
follower1: 1
- leader: string2
follower1: 1
follower1: 2
- leader: string3
follower1: 1
follower1: 3

View file

@ -6,11 +6,11 @@
},
{
"rougail.leader.leader": "string2",
"rougail.leader.follower1": 1
"rougail.leader.follower1": 2
},
{
"rougail.leader.leader": "string3",
"rougail.leader.follower1": 1
"rougail.leader.follower1": 3
}
]
}

View file

@ -4,8 +4,8 @@ rougail:
follower1: string1
follower2: string1
- leader: string2
follower1: string1
follower2: string1
follower1: string2
follower2: string2
- leader: string3
follower1: string1
follower2: string1
follower1: string3
follower2: string3

View file

@ -4,8 +4,8 @@ rougail:
follower1: string1
follower2: string1
- leader: string2
follower1: string1
follower2: string1
follower1: string2
follower2: string2
- leader: string3
follower1: string1
follower2: string1
follower1: string3
follower2: string3

View file

@ -2,5 +2,5 @@ rougail:
leader:
- follower1: string1
follower2: string1
- follower1: string1
follower2: string1
- follower1: string2
follower2: string2

View file

@ -7,13 +7,13 @@
},
{
"rougail.leader.leader": "string2",
"rougail.leader.follower1": "string1",
"rougail.leader.follower2": "string1"
"rougail.leader.follower1": "string2",
"rougail.leader.follower2": "string2"
},
{
"rougail.leader.leader": "string3",
"rougail.leader.follower1": "string1",
"rougail.leader.follower2": "string1"
"rougail.leader.follower1": "string3",
"rougail.leader.follower2": "string3"
}
]
}

View file

@ -7,8 +7,8 @@
},
{
"rougail.leader.leader": "val2",
"rougail.leader.follower1": "string1",
"rougail.leader.follower2": "string1"
"rougail.leader.follower1": "string2",
"rougail.leader.follower2": "string2"
}
]
}

View file

@ -3,6 +3,6 @@ rougail:
- leader: string1
follower1: a
- leader: string2
follower1: a
follower1: b
- leader: string3
follower1: a
follower1: c

View file

@ -3,6 +3,6 @@ rougail:
- leader: string1
follower1: a
- leader: string2
follower1: a
follower1: b
- leader: string3
follower1: a
follower1: c

View file

@ -6,11 +6,11 @@
},
{
"rougail.leader.leader": "string2",
"rougail.leader.follower1": "a"
"rougail.leader.follower1": "b"
},
{
"rougail.leader.leader": "string3",
"rougail.leader.follower1": "a"
"rougail.leader.follower1": "c"
}
]
}

View file

@ -4,6 +4,6 @@ rougail:
- leader: string1
follower: string1
- leader: string2
follower: string1
follower: string2
- leader: string3
follower: string1
follower: string3

View file

@ -4,6 +4,6 @@ rougail:
- leader: string1
follower: string1
- leader: string2
follower: string1
follower: string2
- leader: string3
follower: string1
follower: string3

View file

@ -7,11 +7,11 @@
},
{
"rougail.leader.leader": "string2",
"rougail.leader.follower": "string1"
"rougail.leader.follower": "string2"
},
{
"rougail.leader.leader": "string3",
"rougail.leader.follower": "string1"
"rougail.leader.follower": "string3"
}
]
}

View file

@ -3,6 +3,6 @@ rougail:
- leader: string1
follower1: string1
- leader: string2
follower1: string1
follower1: string2
- leader: string3
follower1: string1
follower1: string3

View file

@ -3,6 +3,6 @@ rougail:
- leader: string1
follower1: string1
- leader: string2
follower1: string1
follower1: string2
- leader: string3
follower1: string1
follower1: string3

View file

@ -6,11 +6,11 @@
},
{
"rougail.leader.leader": "string2",
"rougail.leader.follower1": "string1"
"rougail.leader.follower1": "string2"
},
{
"rougail.leader.leader": "string3",
"rougail.leader.follower1": "string1"
"rougail.leader.follower1": "string3"
}
]
}

View file

@ -3,6 +3,6 @@ rougail:
- leader: string1
follower: string1
- leader: string2
follower: string1
follower: string2
- leader: string3
follower: string1
follower: string3

View file

@ -3,6 +3,6 @@ rougail:
- leader: string1
follower: string1
- leader: string2
follower: string1
follower: string2
- leader: string3
follower: string1
follower: string3

View file

@ -6,11 +6,11 @@
},
{
"rougail.leader.leader": "string2",
"rougail.leader.follower": "string1"
"rougail.leader.follower": "string2"
},
{
"rougail.leader.leader": "string3",
"rougail.leader.follower": "string1"
"rougail.leader.follower": "string3"
}
]
}

View file

@ -4,6 +4,6 @@ rougail:
- leader: string1
follower: string1
- leader: string2
follower: string1
follower: string2
- leader: string3
follower: string1
follower: string3

View file

@ -4,6 +4,6 @@ rougail:
- leader: string1
follower: string1
- leader: string2
follower: string1
follower: string2
- leader: string3
follower: string1
follower: string3

View file

@ -7,11 +7,11 @@
},
{
"rougail.leader.leader": "string2",
"rougail.leader.follower": "string1"
"rougail.leader.follower": "string2"
},
{
"rougail.leader.leader": "string3",
"rougail.leader.follower": "string1"
"rougail.leader.follower": "string3"
}
]
}

View file

@ -4,6 +4,6 @@ rougail:
- leader: string1
follower: string1
- leader: string2
follower: string1
follower: string2
- leader: string3
follower: string1
follower: string3

View file

@ -4,6 +4,6 @@ rougail:
- leader: string1
follower: string1
- leader: string2
follower: string1
follower: string2
- leader: string3
follower: string1
follower: string3

View file

@ -3,6 +3,6 @@ rougail:
- leader: string1
follower: string1
- leader: string2
follower: string1
follower: string2
- leader: string3
follower: string1
follower: string3

View file

@ -7,11 +7,11 @@
},
{
"rougail.leader.leader": "string2",
"rougail.leader.follower": "string1"
"rougail.leader.follower": "string2"
},
{
"rougail.leader.leader": "string3",
"rougail.leader.follower": "string1"
"rougail.leader.follower": "string3"
}
]
}

View file

@ -3,6 +3,6 @@ rougail:
- leader: string1
follower: string1
- leader: string2
follower: string1
follower: string2
- leader: string3
follower: string1
follower: string3

View file

@ -3,6 +3,6 @@ rougail:
- leader: string1
follower: string1
- leader: string2
follower: string1
follower: string2
- leader: string3
follower: string1
follower: string3

View file

@ -6,11 +6,11 @@
},
{
"rougail.leader.leader": "string2",
"rougail.leader.follower": "string1"
"rougail.leader.follower": "string2"
},
{
"rougail.leader.leader": "string3",
"rougail.leader.follower": "string1"
"rougail.leader.follower": "string3"
}
]
}

View file

@ -1,4 +1,8 @@
rougail:
var:
- string1
- string2
- string3
dynstring1:
var: string1
dynstring2:

View file

@ -1,4 +1,8 @@
rougail:
var:
- string1
- string2
- string3
dynstring1:
vardyn: string1
dynstring2:

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,8 @@
rougail:
var:
- val1
- val2
dynval1:
vardyn: string1
dynval2:
vardyn: string1

View file

@ -0,0 +1,5 @@
rougail:
dynval1:
vardyn: string1
dynval2:
vardyn: string1

Some files were not shown because too many files have changed in this diff Show more