Merge pull request 'fenix-admin' (#189) from fenix-admin into main

Reviewed-on: fenix-gitea-admin/iac-teste#189
This commit is contained in:
2025-08-27 19:07:28 +00:00
2 changed files with 17 additions and 4 deletions

View File

@ -11,7 +11,12 @@ packages:
users: users:
%{ for u in each.value.extra_users } %{ for u in each.value.extra_users }
- name: ${u.name} - name: ${u.name}
groups: [${join(", ", u.groups)}] groups:
%{ if length(u.groups) > 0 }
%{ for g in u.groups }
- ${g}
%{ endfor }
%{ endif }
shell: /bin/bash shell: /bin/bash
sudo: ALL=(ALL) NOPASSWD:ALL sudo: ALL=(ALL) NOPASSWD:ALL
%{ endfor } %{ endfor }
@ -19,7 +24,7 @@ users:
chpasswd: chpasswd:
list: list:
%{ for u in each.value.extra_users } %{ for u in each.value.extra_users }
${u.name}:${u.password} - ${u.name}:${u.password}
%{ endfor } %{ endfor }
expire: false expire: false
%{ endif } %{ endif }

View File

@ -41,7 +41,15 @@ def main():
merged = deep_merge_yaml(yaml1, yaml2) merged = deep_merge_yaml(yaml1, yaml2)
print(json.dumps({"merged_yaml": yaml.dump(merged, sort_keys=False)})) print(json.dumps({
"merged_yaml": yaml.dump(
merged,
sort_keys=False,
default_flow_style=False,
indent=2
)
}))
if __name__ == "__main__": if __name__ == "__main__":
main() main()