Nicolas Massé 4 weeks ago
parent
commit
84d422c275
  1. 1
      .gitignore
  2. 7
      Makefile.common
  3. 8
      base/fcos.bu
  4. 43
      base/overlay.bu
  5. 41
      local.bu.template
  6. 11
      nextcloud/fcos.bu
  7. 9
      nginx/fcos.bu
  8. 9
      postgresql/fcos.bu
  9. 9
      qemu-user-static/fcos.bu

1
.gitignore

@ -1,4 +1,5 @@
*.bu
*.ign
!fcos.bu
!overlay.bu
*/butane.blocklist

7
Makefile.common

@ -294,8 +294,9 @@ butane-prerequisites:
# Build the Butane specifications (configuration files) suitable for Fedora CoreOS.
# In order to avoid duplications in the ignition files, a blocklist is updated, containing file paths as they are added to the chroot.
$(PROJECT_NAME).bu: YQ_FILES := $(shell if [ -f "overlay.bu" ]; then echo "- overlay.bu"; else echo "-"; fi)
$(PROJECT_NAME).bu: butane-prerequisites install-config
$(TOP_LEVEL_DIR)/generate-butane-spec.sh $(TARGET_CHROOT) $(BUTANE_BLOCKLIST) $(SYSTEMD_MAIN_UNIT_NAMES) $(SYSTEMD_TIMER_NAMES) > $(PROJECT_NAME).bu
$(TOP_LEVEL_DIR)/generate-butane-spec.sh $(TARGET_CHROOT) $(BUTANE_BLOCKLIST) $(SYSTEMD_MAIN_UNIT_NAMES) $(SYSTEMD_TIMER_NAMES) | yq eval-all '. as $$item ireduce ({}; . *+ $$item)' $(YQ_FILES) > $(PROJECT_NAME).bu
@(cat $(TOP_LEVEL_DIR)/butane.blocklist; echo; for file in $$(find "$$TARGET_CHROOT"); do echo "$${file#$$TARGET_CHROOT}"; done) | sort -u | grep -v -E '^$$' > "$(BUTANE_BLOCKLIST)"
# Build the Butane specifications (example files) suitable for Fedora CoreOS.
@ -403,7 +404,7 @@ console: pre-requisites
virsh console fcos-$(PROJECT_NAME); \
# Restore the terminal size after disconnecting from the VM console. \
# This avoids issues with the terminal being stuck in an incorrect size because \
# of the UEFI / Grub TUI messed with the terminal size during a VM reboot. \
# the UEFI / Grub TUI messed with the terminal size during a VM reboot. \
eval $$(resize -s $$term_size); \
echo -e "Disconnected. Reconnecting in 2 seconds...\nPress Ctrl-C to abort.\n"; \
done
@ -433,7 +434,7 @@ clean-post::
# Remove all persistent data and configuration files
clean: clean-pre pre-requisites
rm -f *.bu *.ign butane.blocklist
rm -f $(PROJECT_NAME){,-examples}.bu *.ign butane.blocklist
@run() { echo $$*; "$$@"; }; \
set -Eeuo pipefail; \
if [ "$(I_KNOW_WHAT_I_AM_DOING)" != "yes" ]; then \

8
base/fcos.bu

@ -0,0 +1,8 @@
variant: fcos
version: 1.4.0
ignition:
config:
merge:
- local: base.ign
- local: base-examples.ign
- local: local.ign

43
base/overlay.bu

@ -0,0 +1,43 @@
variant: fcos
version: 1.4.0
storage:
disks:
- device: /dev/vdb
wipe_table: false
partitions:
# Specify the partition number so that FCOS do not try to create a new
# partition at each VM redeployment.
- number: 1
size_mib: 0
start_mib: 0
label: var
filesystems:
- path: /var
device: /dev/disk/by-partlabel/var
format: xfs
with_mount_unit: true
directories:
- path: /var/lib/private/sshd
mode: 0700
files:
- path: /etc/resolv.conf
overwrite: true
contents:
inline: "" # will be updated by NetworkManager
- path: /etc/NetworkManager/conf.d/itix.conf
contents:
inline: |
[main]
# test
rc-manager=file
systemd:
units:
- name: systemd-resolved.service
enabled: false
mask: true
- name: sshd-keygen@.service
dropins:
- name: backup-restore.conf
contents: |
[Service]
ExecStartPost=/bin/bash -c 'if [ -f /var/lib/private/sshd/ssh_host_%i_key ]; then cp -Z /var/lib/private/sshd/ssh_host_%i_key{,.pub} /etc/ssh/; elif [ -f /etc/ssh/ssh_host_%i_key ]; then cp -a /etc/ssh/ssh_host_%i_key{,.pub} /var/lib/private/sshd/; fi'

41
local.bu.template

@ -1,46 +1,5 @@
variant: fcos
version: 1.4.0
storage:
disks:
- device: /dev/vdb
wipe_table: false
partitions:
# Specify the partition number so that FCOS do not try to create a new
# partition at each VM redeployment.
- number: 1
size_mib: 0
start_mib: 0
label: var
filesystems:
- path: /var
device: /dev/disk/by-partlabel/var
format: xfs
with_mount_unit: true
directories:
- path: /var/lib/private/sshd
mode: 0700
files:
- path: /etc/resolv.conf
overwrite: true
contents:
inline: "" # will be updated by NetworkManager
- path: /etc/NetworkManager/conf.d/itix.conf
contents:
inline: |
[main]
# test
rc-manager=file
systemd:
units:
- name: systemd-resolved.service
enabled: false
mask: true
- name: sshd-keygen@.service
dropins:
- name: backup-restore.conf
contents: |
[Service]
ExecStartPost=/bin/bash -c 'if [ -f /var/lib/private/sshd/ssh_host_%i_key ]; then cp -Z /var/lib/private/sshd/ssh_host_%i_key{,.pub} /etc/ssh/; elif [ -f /etc/ssh/ssh_host_%i_key ]; then cp -a /etc/ssh/ssh_host_%i_key{,.pub} /var/lib/private/sshd/; fi'
passwd:
users:
- name: core

11
nextcloud/fcos.bu

@ -0,0 +1,11 @@
variant: fcos
version: 1.4.0
ignition:
config:
merge:
- local: base.ign
- local: nextcloud.ign
- local: nextcloud-examples.ign
- local: postgresql.ign
- local: postgresql-examples.ign
- local: local.ign

9
nginx/fcos.bu

@ -0,0 +1,9 @@
variant: fcos
version: 1.4.0
ignition:
config:
merge:
- local: base.ign
- local: nginx.ign
- local: nginx-examples.ign
- local: local.ign

9
postgresql/fcos.bu

@ -0,0 +1,9 @@
variant: fcos
version: 1.4.0
ignition:
config:
merge:
- local: base.ign
- local: postgresql.ign
- local: postgresql-examples.ign
- local: local.ign

9
qemu-user-static/fcos.bu

@ -0,0 +1,9 @@
variant: fcos
version: 1.4.0
ignition:
config:
merge:
- local: base.ign
- local: qemu-user-static.ign
- local: qemu-user-static-examples.ign
- local: local.ign
Loading…
Cancel
Save