Nicolas Massé 3 months ago
parent
commit
da8fce21ef
  1. 4
      bootc/base/Containerfile
  2. 8
      bootc/scenario1/root/etc/flightctl/hooks.d/afterupdating/30-nextcloud.yaml
  3. 8
      bootc/scenario4/root/etc/flightctl/hooks.d/afterupdating/30-odoo.yaml
  4. 36
      flightctl/fleets.yaml

4
bootc/base/Containerfile

@ -7,9 +7,11 @@ RUN <<EOF
set -Eeuo pipefail
dnf config-manager --enable ansible-automation-platform-2.5-for-rhel-9-$(arch)-rpms
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
dnf install -y mkpasswd podman skopeo flightctl-agent cockpit cockpit-machines cockpit-podman \
cockpit-files cockpit-ostree cockpit-pcp cockpit-system libvirt libvirt-daemon-kvm \
virt-install virt-top libguestfs-tools genisoimage greenboot greenboot-default-health-checks
virt-install virt-top libguestfs-tools genisoimage greenboot greenboot-default-health-checks \
stress-ng yq podman-compose tmux
dnf clean all
if [ -n "$ADMIN_USERNAME" ]; then

8
bootc/scenario1/root/etc/flightctl/hooks.d/afterupdating/30-nextcloud.yaml

@ -1,4 +1,10 @@
- if:
- path: /etc/containers/systemd/configs/nextcloud-config.env
op: [created, updated, removed]
op: [created, updated]
run: systemctl restart nextcloud.target
timeout: 5m
- if:
- path: /etc/containers/systemd/configs/nextcloud-config.env
op: [removed]
run: /bin/sh -c 'if [ -f /etc/systemd/system/nextcloud.target ]; then systemctl stop nextcloud.target; fi'
timeout: 5m

8
bootc/scenario4/root/etc/flightctl/hooks.d/afterupdating/30-odoo.yaml

@ -1,4 +1,10 @@
- if:
- path: /etc/containers/systemd/configs/odoo-config.env
op: [created, updated, removed]
op: [created, updated]
run: systemctl restart odoo.target
timeout: 5m
- if:
- path: /etc/containers/systemd/configs/odoo-config.env
op: [removed]
run: /bin/sh -c 'if [ -f /etc/systemd/system/odoo.target ]; then systemctl stop odoo.target; fi'
timeout: 5m

36
flightctl/fleets.yaml

@ -1,5 +1,28 @@
apiVersion: flightctl.io/v1alpha1
kind: Fleet
metadata:
annotations: {}
labels:
scenario: 'base'
name: base
spec:
selector:
matchLabels:
scenario: 'base'
template:
metadata:
labels:
fleet: base
spec:
applications: []
config: []
os:
image: edge-registry.itix.fr/demo-edge-retail/base:latest
systemd:
matchPatterns: []
---
apiVersion: flightctl.io/v1alpha1
kind: Fleet
metadata:
annotations: {}
labels:
@ -15,7 +38,6 @@ spec:
fleet: scenario1
spec:
applications: []
config: []
os:
image: edge-registry.itix.fr/demo-edge-retail/scenario1:latest
config:
@ -27,8 +49,10 @@ spec:
targetRevision: main
systemd:
matchPatterns:
- nextcloud-*.service
- nextcloud-*.target
- nextcloud-app.service
- nextcloud-db.service
- nextcloud-nginx.service
- nextcloud-redis.service
---
apiVersion: flightctl.io/v1alpha1
kind: Fleet
@ -74,7 +98,6 @@ spec:
fleet: scenario4
spec:
applications: []
config: []
os:
image: edge-registry.itix.fr/demo-edge-retail/scenario4:latest
config:
@ -86,5 +109,6 @@ spec:
targetRevision: main
systemd:
matchPatterns:
- odoo-*.service
- odoo-*.target
- odoo-app.service
- odoo-db.service
- odoo-init.service

Loading…
Cancel
Save