From 21cc7a8c11f592ecad5f571bc3d2757166a68d94 Mon Sep 17 00:00:00 2001 From: Thomas Hintz Date: Mon, 21 Jul 2025 13:00:29 -0700 Subject: [PATCH] moving configs to local files --- flatcar-quickstart2/caddy.service | 13 +++++++++++++ flatcar-quickstart2/caddyfile-contents | 3 +++ flatcar-quickstart2/cl.yaml | 19 +++---------------- flatcar-quickstart2/ignition.json | 2 +- 4 files changed, 20 insertions(+), 17 deletions(-) create mode 100644 flatcar-quickstart2/caddy.service create mode 100644 flatcar-quickstart2/caddyfile-contents diff --git a/flatcar-quickstart2/caddy.service b/flatcar-quickstart2/caddy.service new file mode 100644 index 0000000..132a8b0 --- /dev/null +++ b/flatcar-quickstart2/caddy.service @@ -0,0 +1,13 @@ +[Unit] +Description=NGINX example +After=docker.service +Requires=docker.service +[Service] +TimeoutStartSec=0 +ExecStartPre=-/usr/bin/docker rm --force caddy2 +ExecStart=/usr/bin/docker run --name caddy2 --pull always --log-driver=journald --net host -v /var/caddy:/etc/caddy docker.io/caddy:2 +ExecStop=/usr/bin/docker stop caddy2 +Restart=always +RestartSec=5s +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/flatcar-quickstart2/caddyfile-contents b/flatcar-quickstart2/caddyfile-contents new file mode 100644 index 0000000..f1ae62f --- /dev/null +++ b/flatcar-quickstart2/caddyfile-contents @@ -0,0 +1,3 @@ +localhost + +respond "Hello, again!" \ No newline at end of file diff --git a/flatcar-quickstart2/cl.yaml b/flatcar-quickstart2/cl.yaml index 2a33080..2c71ab1 100644 --- a/flatcar-quickstart2/cl.yaml +++ b/flatcar-quickstart2/cl.yaml @@ -1,25 +1,12 @@ variant: flatcar -version: 1.0.0 +version: 1.1.0 systemd: units: - name: caddy.service enabled: true - contents: | - [Unit] - Description=NGINX example - After=docker.service - Requires=docker.service - [Service] - TimeoutStartSec=0 - ExecStartPre=-/usr/bin/docker rm --force caddy2 - ExecStart=/usr/bin/docker run --name caddy2 --pull always --log-driver=journald --net host -v /var/caddy:/etc/caddy docker.io/caddy:2 - ExecStop=/usr/bin/docker stop caddy2 - Restart=always - RestartSec=5s - [Install] - WantedBy=multi-user.target + contents_local: caddy.service storage: files: - path: /var/caddy/Caddyfile contents: - inline: "localhost\n\nrespond \"Hello, world!\"" + local: caddyfile-contents diff --git a/flatcar-quickstart2/ignition.json b/flatcar-quickstart2/ignition.json index c1c3f76..150c04b 100644 --- a/flatcar-quickstart2/ignition.json +++ b/flatcar-quickstart2/ignition.json @@ -1 +1 @@ -{"ignition":{"version":"3.3.0"},"storage":{"files":[{"path":"/var/caddy/Caddyfile","contents":{"compression":"","source":"data:,localhost%0A%0Arespond%20%22Hello%2C%20world!%22"}}]},"systemd":{"units":[{"contents":"[Unit]\nDescription=NGINX example\nAfter=docker.service\nRequires=docker.service\n[Service]\nTimeoutStartSec=0\nExecStartPre=-/usr/bin/docker rm --force caddy2\nExecStart=/usr/bin/docker run --name caddy2 --pull always --log-driver=journald --net host -v /var/caddy:/etc/caddy docker.io/caddy:2\nExecStop=/usr/bin/docker stop caddy2\nRestart=always\nRestartSec=5s\n[Install]\nWantedBy=multi-user.target\n","enabled":true,"name":"caddy.service"}]}} +{"ignition":{"version":"3.4.0"},"storage":{"files":[{"path":"/var/caddy/Caddyfile","contents":{"compression":"","source":"data:,localhost%0A%0Arespond%20%22Hello%2C%20again!%22"}}]},"systemd":{"units":[{"contents":"[Unit]\nDescription=NGINX example\nAfter=docker.service\nRequires=docker.service\n[Service]\nTimeoutStartSec=0\nExecStartPre=-/usr/bin/docker rm --force caddy2\nExecStart=/usr/bin/docker run --name caddy2 --pull always --log-driver=journald --net host -v /var/caddy:/etc/caddy docker.io/caddy:2\nExecStop=/usr/bin/docker stop caddy2\nRestart=always\nRestartSec=5s\n[Install]\nWantedBy=multi-user.target","enabled":true,"name":"caddy.service"}]}}