feat: tuxflotte_auftrag_optionen an ansible-pull durchreichen
apply_roles() baut zusätzlich zu den present/absent-States ein optionen-Dict je Rolle aus der Check-in-Antwort und gibt es im selben --extra-vars-JSON mit (z.B. standardbrowser für brave-fedora). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
9799a3daa0
commit
03f70e747a
6
agent.py
6
agent.py
@ -71,6 +71,7 @@ def apply_roles(ansible_repo, blueprints, auftraege):
|
|||||||
| {a["ansible_role"] for a in auftraege}
|
| {a["ansible_role"] for a in auftraege}
|
||||||
)
|
)
|
||||||
auftrag_states = {a["ansible_role"]: a["state"] for a in auftraege}
|
auftrag_states = {a["ansible_role"]: a["state"] for a in auftraege}
|
||||||
|
auftrag_optionen = {a["ansible_role"]: a.get("optionen", {}) for a in auftraege}
|
||||||
|
|
||||||
log(f"Applying roles via ansible-pull: {','.join(roles)}")
|
log(f"Applying roles via ansible-pull: {','.join(roles)}")
|
||||||
|
|
||||||
@ -80,7 +81,10 @@ def apply_roles(ansible_repo, blueprints, auftraege):
|
|||||||
"-U", ansible_repo,
|
"-U", ansible_repo,
|
||||||
"--tags", ",".join(roles),
|
"--tags", ",".join(roles),
|
||||||
"-i", "localhost,",
|
"-i", "localhost,",
|
||||||
"-e", json.dumps({"tuxflotte_auftrag_states": auftrag_states}),
|
"-e", json.dumps({
|
||||||
|
"tuxflotte_auftrag_states": auftrag_states,
|
||||||
|
"tuxflotte_auftrag_optionen": auftrag_optionen,
|
||||||
|
}),
|
||||||
"site.yml",
|
"site.yml",
|
||||||
],
|
],
|
||||||
check=False,
|
check=False,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user