75 changed files with 229 additions and 234 deletions
@ -0,0 +1,22 @@ |
|||||
|
FROM edge-registry.itix.fr/demo-edge-retail/base:latest |
||||
|
|
||||
|
RUN <<EOF |
||||
|
set -Eeuo pipefail |
||||
|
|
||||
|
# Install virtualization packages |
||||
|
dnf install -y cockpit-machines libvirt libvirt-daemon-kvm virt-install virt-top \ |
||||
|
libguestfs-tools genisoimage smartmontools hdparm rclone virt-v2v \ |
||||
|
virt-v2v-bash-completion libguestfs-winsupport |
||||
|
dnf clean all |
||||
|
|
||||
|
EOF |
||||
|
|
||||
|
ADD --chown=root:root root / |
||||
|
|
||||
|
RUN <<EOF |
||||
|
set -Eeuo pipefail |
||||
|
|
||||
|
# Enable systemd services and sockets |
||||
|
systemctl enable libvirtd.service libvirt-guests.service |
||||
|
|
||||
|
EOF |
||||
@ -1,8 +0,0 @@ |
|||||
FROM edge-registry.itix.fr/demo-edge-retail/base:latest |
|
||||
|
|
||||
ADD --chown=root:root root / |
|
||||
|
|
||||
RUN <<EOF |
|
||||
set -Eeuo pipefail |
|
||||
systemctl enable nextcloud.target |
|
||||
EOF |
|
||||
@ -1,10 +0,0 @@ |
|||||
- if: |
|
||||
- path: /etc/containers/systemd/configs/nextcloud-config.env |
|
||||
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 |
|
||||
@ -1,8 +0,0 @@ |
|||||
FROM edge-registry.itix.fr/demo-edge-retail/base:latest |
|
||||
|
|
||||
ADD --chown=root:root root / |
|
||||
|
|
||||
RUN <<EOF |
|
||||
set -Eeuo pipefail |
|
||||
systemctl enable migrate-vm@printserver.service |
|
||||
EOF |
|
||||
@ -1,8 +0,0 @@ |
|||||
FROM edge-registry.itix.fr/demo-edge-retail/base:latest |
|
||||
|
|
||||
ADD --chown=root:root root / |
|
||||
|
|
||||
RUN <<EOF |
|
||||
set -Eeuo pipefail |
|
||||
systemctl enable bootstrap-vm@nextcloud.service |
|
||||
EOF |
|
||||
@ -1 +0,0 @@ |
|||||
../default.xml |
|
||||
@ -1,19 +0,0 @@ |
|||||
<network> |
|
||||
<name>default</name> |
|
||||
<bridge name="virbr0" stp="on" delay="5" /> |
|
||||
<forward mode='nat' /> |
|
||||
<domain name="libvirt.test" /> |
|
||||
<dns> |
|
||||
<host ip='192.168.122.1'> |
|
||||
<hostname>host</hostname> |
|
||||
</host> |
|
||||
</dns> |
|
||||
<ip address="192.168.122.1" netmask="255.255.255.0" localPtr="yes"> |
|
||||
<dhcp> |
|
||||
<range start="192.168.122.100" end="192.168.122.200"> |
|
||||
<lease expiry='24' unit='hours'/> |
|
||||
</range> |
|
||||
<host mac="04:00:00:00:00:01" name="nextcloud" ip="192.168.122.2" /> |
|
||||
</dhcp> |
|
||||
</ip> |
|
||||
</network> |
|
||||
@ -1,8 +0,0 @@ |
|||||
FROM edge-registry.itix.fr/demo-edge-retail/base:latest |
|
||||
|
|
||||
ADD --chown=root:root root / |
|
||||
|
|
||||
RUN <<EOF |
|
||||
set -Eeuo pipefail |
|
||||
systemctl enable odoo.target |
|
||||
EOF |
|
||||
@ -1,10 +0,0 @@ |
|||||
- if: |
|
||||
- path: /etc/containers/systemd/configs/odoo-config.env |
|
||||
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 |
|
||||
@ -0,0 +1,54 @@ |
|||||
|
#!/bin/bash |
||||
|
|
||||
|
set -Eeuo pipefail |
||||
|
|
||||
|
if [[ "$UID" -ne 0 ]]; then |
||||
|
echo "This command must be run as root!" |
||||
|
exit 1 |
||||
|
fi |
||||
|
|
||||
|
if [ "$#" -lt 1 ]; then |
||||
|
echo "Usage: $0 <bootc-target-image> [qcow2-target-image]" |
||||
|
exit 1 |
||||
|
fi |
||||
|
|
||||
|
TARGET_IMAGE="$1" |
||||
|
|
||||
|
OCI_REGISTRY="${TARGET_IMAGE%%/*}" |
||||
|
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" |
||||
|
PROJECT_DIR="$(dirname "$SCRIPT_DIR")" |
||||
|
|
||||
|
if [ ! -f "$PROJECT_DIR/signing-key.pass" ]; then |
||||
|
openssl rand -base64 30 > "$PROJECT_DIR/signing-key.pass" |
||||
|
chmod 600 "$PROJECT_DIR/signing-key.pass" |
||||
|
fi |
||||
|
|
||||
|
if [ ! -f "$PROJECT_DIR/signing-key.pub" ]; then |
||||
|
skopeo generate-sigstore-key --output-prefix "$PROJECT_DIR/signing-key" --passphrase-file "$PROJECT_DIR/signing-key.pass" |
||||
|
fi |
||||
|
|
||||
|
if [ ! -f "/etc/containers/registries.d/${OCI_REGISTRY}.yaml" ]; then |
||||
|
tee "/etc/containers/registries.d/${OCI_REGISTRY}.yaml" > /dev/null <<EOF |
||||
|
docker: |
||||
|
${OCI_REGISTRY}: |
||||
|
use-sigstore-attachments: true |
||||
|
EOF |
||||
|
fi |
||||
|
|
||||
|
export REGISTRY_AUTH_FILE="$PROJECT_DIR/auth.json" |
||||
|
if [ ! -f "$REGISTRY_AUTH_FILE" ]; then |
||||
|
echo "Please enter your credentials for ${OCI_REGISTRY}:" |
||||
|
podman login "${OCI_REGISTRY}" |
||||
|
|
||||
|
echo "Please enter your credentials for registry.redhat.io:" |
||||
|
podman login registry.redhat.io |
||||
|
fi |
||||
|
|
||||
|
if [ -x "$PWD/custom.sh" ]; then |
||||
|
echo "Running custom.sh..." |
||||
|
"$PWD/custom.sh" |
||||
|
fi |
||||
|
|
||||
|
echo "Building and pushing image $TARGET_IMAGE..." |
||||
|
podman build --no-cache -t "${TARGET_IMAGE}" . |
||||
|
podman push --sign-by-sigstore-private-key "$PROJECT_DIR/signing-key.private" --sign-passphrase-file "$PROJECT_DIR/signing-key.pass" "${TARGET_IMAGE}" |
||||
@ -0,0 +1,20 @@ |
|||||
|
FROM edge-registry.itix.fr/demo-edge-retail/base:latest |
||||
|
|
||||
|
RUN <<EOF |
||||
|
set -Eeuo pipefail |
||||
|
|
||||
|
# Install the Qemu guest agent |
||||
|
dnf install -y qemu-guest-agent |
||||
|
dnf clean all |
||||
|
|
||||
|
EOF |
||||
|
|
||||
|
ADD --chown=root:root root / |
||||
|
|
||||
|
RUN <<EOF |
||||
|
set -Eeuo pipefail |
||||
|
|
||||
|
# The flightctl-agent configuration will be injected here by the hypervisor |
||||
|
install -d -m 0700 -o root -g root /var/lib/private/flightctl |
||||
|
|
||||
|
EOF |
||||
@ -0,0 +1,5 @@ |
|||||
|
- if: |
||||
|
- path: /etc/default/bootstrap-vm-nextcloud.env |
||||
|
op: [created, updated] |
||||
|
run: /bin/sh -Eeuo pipefail -c 'systemctl enable bootstrap-vm@nextcloud.service ; systemctl restart bootstrap-vm@nextcloud.service' |
||||
|
timeout: 5m |
||||
@ -0,0 +1,5 @@ |
|||||
|
- if: |
||||
|
- path: /etc/default/bootstrap-vm-nextcloud.env |
||||
|
op: [removed] |
||||
|
run: /bin/sh -c 'if [ -f /etc/systemd/system/bootstrap-vm@.service ]; then systemctl stop bootstrap-vm@nextcloud.service ; systemctl disable bootstrap-vm@nextcloud.service ; fi' |
||||
|
timeout: 5m |
||||
@ -0,0 +1,5 @@ |
|||||
|
- if: |
||||
|
- path: /etc/default/migrate-vm-printserver.env |
||||
|
op: [created, updated] |
||||
|
run: /bin/sh -Eeuo pipefail -c 'systemctl enable migrate-vm@printserver.service ; systemctl restart migrate-vm@printserver.service' |
||||
|
timeout: 5m |
||||
@ -0,0 +1,5 @@ |
|||||
|
- if: |
||||
|
- path: /etc/default/migrate-vm-printserver.env |
||||
|
op: [removed] |
||||
|
run: /bin/sh -c 'if [ -f /etc/systemd/system/migrate-vm@.service ]; then systemctl stop migrate-vm@printserver.service ; systemctl disable migrate-vm@printserver.service ; fi' |
||||
|
timeout: 5m |
||||
@ -0,0 +1,5 @@ |
|||||
|
- if: |
||||
|
- path: /etc/containers/systemd/nextcloud/nextcloud-config.env |
||||
|
op: [created, updated] |
||||
|
run: /bin/sh -Eeuo pipefail -c 'systemctl enable nextcloud.target ; systemctl restart nextcloud.target' |
||||
|
timeout: 5m |
||||
@ -0,0 +1,5 @@ |
|||||
|
- if: |
||||
|
- path: /etc/containers/systemd/nextcloud/nextcloud-config.env |
||||
|
op: [removed] |
||||
|
run: /bin/sh -c 'if [ -f /etc/systemd/system/nextcloud.target ]; then systemctl stop nextcloud.target ; systemctl disable nextcloud.target ; fi' |
||||
|
timeout: 5m |
||||
@ -0,0 +1,5 @@ |
|||||
|
- if: |
||||
|
- path: /etc/containers/systemd/odoo/odoo-config.env |
||||
|
op: [created, updated] |
||||
|
run: /bin/sh -Eeuo pipefail -c 'systemctl enable odoo.target ; systemctl restart odoo.target' |
||||
|
timeout: 5m |
||||
@ -0,0 +1,5 @@ |
|||||
|
- if: |
||||
|
- path: /etc/containers/systemd/odoo/odoo-config.env |
||||
|
op: [removed] |
||||
|
run: /bin/sh -c 'if [ -f /etc/systemd/system/odoo.target ]; then systemctl stop odoo.target ; systemctl disable odoo.target ; fi' |
||||
|
timeout: 5m |
||||
@ -0,0 +1,16 @@ |
|||||
|
## |
||||
|
## Nextcloud Configuration Environment Variables |
||||
|
## |
||||
|
|
||||
|
# Nextcloud domain configuration |
||||
|
NEXTCLOUD_TRUSTED_DOMAINS=optiplex-7000.itix.fr |
||||
|
OVERWRITEHOST=optiplex-7000.itix.fr |
||||
|
OVERWRITEPROTOCOL=http |
||||
|
OVERWRITECLIURL=http://optiplex-7000.itix.fr |
||||
|
|
||||
|
# Nextcloud admin credentials |
||||
|
NEXTCLOUD_ADMIN_USER=admin |
||||
|
NEXTCLOUD_ADMIN_PASSWORD=nextcloud |
||||
|
|
||||
|
# Nextcloud server info token |
||||
|
NEXTCLOUD_SERVERINFO_TOKEN=S3cr3t! |
||||
@ -0,0 +1,16 @@ |
|||||
|
## |
||||
|
## Nextcloud Configuration Environment Variables |
||||
|
## |
||||
|
|
||||
|
# Nextcloud domain configuration |
||||
|
NEXTCLOUD_TRUSTED_DOMAINS=adlink-dlap-4001.itix.fr |
||||
|
OVERWRITEHOST=adlink-dlap-4001.itix.fr |
||||
|
OVERWRITEPROTOCOL=http |
||||
|
OVERWRITECLIURL=http://adlink-dlap-4001.itix.fr |
||||
|
|
||||
|
# Nextcloud admin credentials |
||||
|
NEXTCLOUD_ADMIN_USER=admin |
||||
|
NEXTCLOUD_ADMIN_PASSWORD=nextcloud |
||||
|
|
||||
|
# Nextcloud server info token |
||||
|
NEXTCLOUD_SERVERINFO_TOKEN=S3cr3t! |
||||
@ -1,6 +0,0 @@ |
|||||
|
|
||||
|
|
||||
HEADS UP !!! |
|
||||
|
|
||||
This system is not configured ! |
|
||||
|
|
||||
@ -1,4 +0,0 @@ |
|||||
DATABASE=redhat |
|
||||
ADMIN_PASSWORD=R3dH4t! |
|
||||
RIBBON_COLOR=rgba(255,0,0,.6) |
|
||||
RIBBON_NAME=Paris Wagram<br/>({db_name}) |
|
||||
@ -1,4 +0,0 @@ |
|||||
DATABASE=redhat |
|
||||
ADMIN_PASSWORD=R3dH4t! |
|
||||
RIBBON_COLOR=rgba(0,0,255,.6) |
|
||||
RIBBON_NAME=Villeneuve d'Ascq<br/>({db_name}) |
|
||||
Loading…
Reference in new issue