mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-05-09 23:05:43 +02:00
Solved application generation bugs
This commit is contained in:
parent
5b47333955
commit
a2e6c9881a
36
cli/fix_tabs.py
Normal file
36
cli/fix_tabs.py
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import os
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
ROLES_DIR = Path("roles") # Adjust this if needed
|
||||||
|
FILES_FIXED = []
|
||||||
|
|
||||||
|
def fix_tabs_in_file(file_path):
|
||||||
|
with open(file_path, "r") as f:
|
||||||
|
lines = f.readlines()
|
||||||
|
|
||||||
|
if any('\t' in line for line in lines):
|
||||||
|
fixed_lines = [line.replace('\t', ' ') for line in lines]
|
||||||
|
with open(file_path, "w") as f:
|
||||||
|
f.writelines(fixed_lines)
|
||||||
|
FILES_FIXED.append(str(file_path))
|
||||||
|
|
||||||
|
def main():
|
||||||
|
for role_dir in sorted(ROLES_DIR.iterdir()):
|
||||||
|
if not role_dir.is_dir():
|
||||||
|
continue
|
||||||
|
|
||||||
|
vars_main = role_dir / "vars" / "main.yml"
|
||||||
|
if vars_main.exists():
|
||||||
|
fix_tabs_in_file(vars_main)
|
||||||
|
|
||||||
|
if FILES_FIXED:
|
||||||
|
print("✅ Fixed tab characters in the following files:")
|
||||||
|
for f in FILES_FIXED:
|
||||||
|
print(f" - {f}")
|
||||||
|
else:
|
||||||
|
print("✅ No tabs found in any vars/main.yml files.")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
@ -26,7 +26,7 @@ def main():
|
|||||||
|
|
||||||
result = {"default_applications": {}}
|
result = {"default_applications": {}}
|
||||||
|
|
||||||
for role_dir in sorted(roles_dir.glob("docker-*")):
|
for role_dir in sorted(roles_dir.iterdir()):
|
||||||
role_name = role_dir.name
|
role_name = role_dir.name
|
||||||
vars_main = role_dir / "vars" / "main.yml"
|
vars_main = role_dir / "vars" / "main.yml"
|
||||||
config_file = role_dir / "vars" / "configuration.yml"
|
config_file = role_dir / "vars" / "configuration.yml"
|
||||||
|
@ -1 +0,0 @@
|
|||||||
version: "latest"
|
|
3
roles/docker-mariadb/vars/main.yml
Normal file
3
roles/docker-mariadb/vars/main.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version: "latest"
|
||||||
|
application_id: "mariadb"
|
||||||
|
hostname: "central-{{application_id}}"
|
@ -1,7 +1,7 @@
|
|||||||
# General Configuration
|
# General Configuration
|
||||||
application_id: syncope
|
application_id: syncope
|
||||||
database_type: "postgres"
|
database_type: "postgres"
|
||||||
database_password: {{ domains[application_id].credentials.database_password }}
|
database_password: "{{ domains[application_id].credentials.database_password }}"
|
||||||
|
|
||||||
# Application Specific
|
# Application Specific
|
||||||
syncope_keymaster_address: http://localhost:8080/syncope/rest/keymaster
|
syncope_keymaster_address: http://localhost:8080/syncope/rest/keymaster
|
||||||
@ -10,8 +10,8 @@ syncope_paths:
|
|||||||
console: console
|
console: console
|
||||||
enduser: enduser
|
enduser: enduser
|
||||||
|
|
||||||
syncope_anonymous_user: {{ domains[application_id].users.anonymous.username }}
|
syncope_anonymous_user: "{{ domains[application_id].users.anonymous.username }}"
|
||||||
syncope_anonymous_password: {{ domains[application_id].credentials.anonymous.password }}
|
syncope_anonymous_password: "{{ domains[application_id].credentials.anonymous.password }}"
|
||||||
|
|
||||||
syncope_administrator_user: {{ domains[application_id].users.administrator.username }}
|
syncope_administrator_user: "{{ domains[application_id].users.administrator.username }}"
|
||||||
syncope_administrator_password: {{ domains[application_id].credentials.administrator_password }}
|
syncope_administrator_password: "{{ domains[application_id].credentials.administrator_password }}"
|
Loading…
x
Reference in New Issue
Block a user