From 94aad8e6ea3f40cd1cc0699dee80db615f1d521c Mon Sep 17 00:00:00 2001 From: realaravinth Date: Sat, 25 Jun 2022 18:00:13 +0530 Subject: [PATCH] fix: templates: load user credentials and pass dynamic configuration. Also escape curly braces --- .../infrastructure/sh/hostscripts/create.sh | 4 ++-- .../infrastructure/sh/hostscripts/rm.sh | 2 +- .../templates/infrastructure/yml/gitea.yml | 18 +++++++++--------- .../templates/infrastructure/yml/provision.yml | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/infrastructure/templates/infrastructure/sh/hostscripts/create.sh b/infrastructure/templates/infrastructure/sh/hostscripts/create.sh index ad607bc..5511578 100644 --- a/infrastructure/templates/infrastructure/sh/hostscripts/create.sh +++ b/infrastructure/templates/infrastructure/sh/hostscripts/create.sh @@ -1,2 +1,2 @@ -enough --domain d.hostea.org host create {{subdomain}}-host -enough --domain d.hostea.org service create --host {{subdomain}}-host gitea +enough --domain d.{{ hostea_domain }} host create {{subdomain}}-host +enough --domain d.{{ hostea_domain }} service create --host {{subdomain}}-host gitea diff --git a/infrastructure/templates/infrastructure/sh/hostscripts/rm.sh b/infrastructure/templates/infrastructure/sh/hostscripts/rm.sh index 0eeb490..61d1a22 100644 --- a/infrastructure/templates/infrastructure/sh/hostscripts/rm.sh +++ b/infrastructure/templates/infrastructure/sh/hostscripts/rm.sh @@ -1 +1 @@ -enough --domain d.hostea.org host delete hostea001-host +enough --domain d.{{ hostea_domain }} host delete hostea001-host diff --git a/infrastructure/templates/infrastructure/yml/gitea.yml b/infrastructure/templates/infrastructure/yml/gitea.yml index 8a3c99e..fcf7aab 100644 --- a/infrastructure/templates/infrastructure/yml/gitea.yml +++ b/infrastructure/templates/infrastructure/yml/gitea.yml @@ -5,14 +5,14 @@ # Public hostname of the Gitea instance # # -gitea_host: "gitea.{{ domain }}" +gitea_host: "{{ subdomain }}.{{ '{' }}{{ '{' }} domain {{ '}' }}{{ '}' }}" # ####################################### # # Mailer from # # -gitea_mailer_from: "noreply@enough.community" +gitea_mailer_from: "noreply@{{ '{' }}{{ '{' }} domain {{ '}' }}{{ '}' }}" # ####################################### # @@ -38,37 +38,37 @@ gitea_user: root # # Admin user password # -#gitea_password: etquofEtseudett +gitea_password: "{{ gitea_password }}" # ####################################### # # Admin user email # -gitea_email: contact@enough.community +gitea_email: "{{ gitea_email }}" # ####################################### # -# Unique hostname of the woodpecker server relative to {{ domain }} +# Unique hostname of the woodpecker server relative to {{ '{' }}{{ '{' }} domain {{ '}' }}{{ '}' }} # -woodpecker_hostname: "woodpecker" +woodpecker_hostname: "{{ woodpecker_hostname }}" # ####################################### # # Public hostname of the Woodpecker instance # -woodpecker_host: "{{ woodpecker_hostname }}.{{ domain }}" +woodpecker_host: "{{ '{' }}{{ '{' }} woodpecker_hostname {{ '}' }}{{ '}' }}.{{ '{' }}{{ '{' }} domain {{ '}' }}{{ '}' }}" # ####################################### # # Gitea users with admin rights on woodpecker # -woodpecker_admins: "{{ gitea_user }}" +woodpecker_admins: "{{ '{' }}{{ '{' }} gitea_user {{ '}' }}{{ '}' }}" # ####################################### # # Woodpecker shared agent secret `openssl rand -hex 32` # -#woodpecker_agent_secret: c2cd326f7104c2ca93e6d22da0b28d1e33b4aeaa071c08945e0ade576b3192ce +woodpecker_agent_secret: {{ woodpecker_agent_secret }} # ####################################### # diff --git a/infrastructure/templates/infrastructure/yml/provision.yml b/infrastructure/templates/infrastructure/yml/provision.yml index 09998e7..ab67c1e 100644 --- a/infrastructure/templates/infrastructure/yml/provision.yml +++ b/infrastructure/templates/infrastructure/yml/provision.yml @@ -1 +1 @@ -openstack_flavor: "\{\{ {{ vm_size }} \}\}" +openstack_flavor: {{ vm_size }}