From 786145e914cf1412202f134b4e8209dbd2c75ae6 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sat, 3 Feb 2024 10:24:38 -0600 Subject: [PATCH] env/prod: Collect common tempates in module In order to simplify the process of adding new template render instructions to all hosts, I've created a list of templates in the `env/prod` module. This way, I only have to add templates there, and all hosts that "inherit" from it will automatically get them. --- env/prod/instructions.cue | 13 +++++++++++++ instructions/k8s-amd64-n3.pyrocufflink.blue.cue | 4 ++-- instructions/nut0.pyrocufflink.blue.cue | 6 ++---- instructions/nvr1.pyrocufflink.blue.cue | 6 ++---- instructions/serial1.pyrocufflink.blue.cue | 6 ++---- 5 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 env/prod/instructions.cue diff --git a/env/prod/instructions.cue b/env/prod/instructions.cue new file mode 100644 index 0000000..b631a19 --- /dev/null +++ b/env/prod/instructions.cue @@ -0,0 +1,13 @@ +package prod + +import ( + "list" + + "du5t1n.me/cfg/app/ssh" + "du5t1n.me/cfg/app/sudo" +) + +templates: list.Concat([ + ssh.templates, + sudo.templates, +]) diff --git a/instructions/k8s-amd64-n3.pyrocufflink.blue.cue b/instructions/k8s-amd64-n3.pyrocufflink.blue.cue index 0e1f635..0c52f70 100644 --- a/instructions/k8s-amd64-n3.pyrocufflink.blue.cue +++ b/instructions/k8s-amd64-n3.pyrocufflink.blue.cue @@ -1,9 +1,9 @@ import ( "list" - "du5t1n.me/cfg/app/sudo" + "du5t1n.me/cfg/env/prod" ) render: list.Concat([ - sudo.templates, + prod.templates, ]) diff --git a/instructions/nut0.pyrocufflink.blue.cue b/instructions/nut0.pyrocufflink.blue.cue index 79ae999..cedb29c 100644 --- a/instructions/nut0.pyrocufflink.blue.cue +++ b/instructions/nut0.pyrocufflink.blue.cue @@ -5,8 +5,7 @@ import ( "du5t1n.me/cfg/app/collectd" "du5t1n.me/cfg/app/nut" - "du5t1n.me/cfg/app/ssh" - "du5t1n.me/cfg/app/sudo" + "du5t1n.me/cfg/env/prod" ) render: list.Concat([ @@ -14,6 +13,5 @@ render: list.Concat([ nut.templates, nut.monitor.templates, nut.collectd.templates, - ssh.templates, - sudo.templates, + prod.templates, ]) diff --git a/instructions/nvr1.pyrocufflink.blue.cue b/instructions/nvr1.pyrocufflink.blue.cue index a2f4df4..d220b9c 100644 --- a/instructions/nvr1.pyrocufflink.blue.cue +++ b/instructions/nvr1.pyrocufflink.blue.cue @@ -4,13 +4,11 @@ import ( "list" "du5t1n.me/cfg/app/nut" - "du5t1n.me/cfg/app/ssh" - "du5t1n.me/cfg/app/sudo" + "du5t1n.me/cfg/env/prod" ) render: list.Concat([ nut.sysusers.templates, nut.monitor.templates, - ssh.templates, - sudo.templates, + prod.templates, ]) diff --git a/instructions/serial1.pyrocufflink.blue.cue b/instructions/serial1.pyrocufflink.blue.cue index cd758a1..98c008c 100644 --- a/instructions/serial1.pyrocufflink.blue.cue +++ b/instructions/serial1.pyrocufflink.blue.cue @@ -4,12 +4,10 @@ import ( "list" "du5t1n.me/cfg/app/collectd" - "du5t1n.me/cfg/app/ssh" - "du5t1n.me/cfg/app/sudo" + "du5t1n.me/cfg/env/prod" ) render: list.Concat([ collectd.templates, - ssh.templates, - sudo.templates, + prod.templates, ])