@@ -9,37 +9,44 @@ def IaC_template_generator_argocd(input) -> str:
99 argocd_application_selfheal = 'true' if input .argocd_application .sync_policy .self_heal else 'false'
1010 else :
1111 argocd_create_application = 'false'
12- argocd_application_auto_prune = ""
13- argocd_application_selfheal = ""
12+ argocd_application_auto_prune = "false "
13+ argocd_application_selfheal = "false "
1414
15- depends_on = 'depends_on = []'
16- if input .application_depends_repository == True :
17- depends_on = 'depends_on = [argocd_repository.repository]'
18-
19- tfvars_file = """
20- argocd_instance_info = {
21- server_addr = "ARGOCD_DOMAIN"
22- username = "admin"
23- password = "ARGOCD_ADMIN_PASS"
15+
16+ argocd_instance_info = """{
17+ server_addr = "http://argocd.local"
18+ username = "username"
19+ password = "password"
2420 insecure = true
2521}
26-
27- repository_create = true
28- argocd_repository_info = {
29- repo = "https://YOUR_REPO.git"
30- username = "USERNAME"
31- password = "CHANGE_ME_WITH_TOKEN"
22+ """
23+ argocd_repository_info = """{
24+ repo = "https://your_repo.git"
25+ username = "username"
26+ password = "token"
3227}
33-
34- application_create = true
35- argocd_application = {
36- name = "APPLICATION_NAME"
28+ """
29+ argocd_application = """{
30+ name = "myapp"
3731 destination_server = "https://kubernetes.default.svc"
38- destination_namespace = "DESTINATION_NAMESPACE "
39- source_repo_url = "https://YOUR_REPO .git"
40- source_path = "SOURCE_PATH "
41- source_target_revision = "SOURCE_TARGET_REVISION "
32+ destination_namespace = "default "
33+ source_repo_url = "https://your_repo .git"
34+ source_path = "myapp/manifests "
35+ source_target_revision = "master "
4236}
37+ """
38+
39+ tfvars_file = f"""
40+ argocd_instance_info = { argocd_instance_info }
41+
42+ repository_create = { argocd_create_repository }
43+ argocd_repository_info = { argocd_repository_info }
44+
45+ application_create = { argocd_create_application }
46+ argocd_application = { argocd_application }
47+
48+ argocd_sync_options = ["CreateNamespace=true", "ApplyOutOfSyncOnly=true", "FailOnSharedResource=true"]
4349
44- argocd_sync_options = ["CreateNamespace=true", "ApplyOutOfSyncOnly=true", "FailOnSharedResource=true"]"""
50+ auto_prune = { argocd_application_auto_prune }
51+ self_heal = { argocd_application_selfheal } """
4552 return tfvars_file
0 commit comments