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 set -Eeuo pipefail
dnf config-manager --enable ansible-automation-platform-2.5-for-rhel-9-$(arch)-rpms 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 \ 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 \ 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 dnf clean all
if [ -n "$ADMIN_USERNAME" ]; then if [ -n "$ADMIN_USERNAME" ]; then

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

@ -1,4 +1,10 @@
- if: - if:
- path: /etc/containers/systemd/configs/nextcloud-config.env - path: /etc/containers/systemd/configs/nextcloud-config.env
op: [created, updated, removed] op: [created, updated]
run: systemctl restart nextcloud.target 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: - if:
- path: /etc/containers/systemd/configs/odoo-config.env - path: /etc/containers/systemd/configs/odoo-config.env
op: [created, updated, removed] op: [created, updated]
run: systemctl restart odoo.target 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 apiVersion: flightctl.io/v1alpha1
kind: Fleet 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: metadata:
annotations: {} annotations: {}
labels: labels:
@ -15,7 +38,6 @@ spec:
fleet: scenario1 fleet: scenario1
spec: spec:
applications: [] applications: []
config: []
os: os:
image: edge-registry.itix.fr/demo-edge-retail/scenario1:latest image: edge-registry.itix.fr/demo-edge-retail/scenario1:latest
config: config:
@ -27,8 +49,10 @@ spec:
targetRevision: main targetRevision: main
systemd: systemd:
matchPatterns: matchPatterns:
- nextcloud-*.service - nextcloud-app.service
- nextcloud-*.target - nextcloud-db.service
- nextcloud-nginx.service
- nextcloud-redis.service
--- ---
apiVersion: flightctl.io/v1alpha1 apiVersion: flightctl.io/v1alpha1
kind: Fleet kind: Fleet
@ -74,7 +98,6 @@ spec:
fleet: scenario4 fleet: scenario4
spec: spec:
applications: [] applications: []
config: []
os: os:
image: edge-registry.itix.fr/demo-edge-retail/scenario4:latest image: edge-registry.itix.fr/demo-edge-retail/scenario4:latest
config: config:
@ -86,5 +109,6 @@ spec:
targetRevision: main targetRevision: main
systemd: systemd:
matchPatterns: matchPatterns:
- odoo-*.service - odoo-app.service
- odoo-*.target - odoo-db.service
- odoo-init.service

Loading…
Cancel
Save