Compare commits
3 commits
main
...
fix-ansibl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf1995b532 | ||
|
|
522d95694b | ||
|
|
4c630b5860 |
27 changed files with 242 additions and 359 deletions
|
|
@ -6,8 +6,8 @@ variables:
|
||||||
PACKER_VERSION: 1.4.3
|
PACKER_VERSION: 1.4.3
|
||||||
ANNOUNCE: http://labsync.lab.fablab-nea.de:6969/announce
|
ANNOUNCE: http://labsync.lab.fablab-nea.de:6969/announce
|
||||||
WEBSEED: http://labsync.lab.fablab-nea.de/labsync/$CI_COMMIT_REF_NAME/$CI_PIPELINE_ID/images
|
WEBSEED: http://labsync.lab.fablab-nea.de/labsync/$CI_COMMIT_REF_NAME/$CI_PIPELINE_ID/images
|
||||||
DOCKER_IMAGE_BUILDER: ${CI_REGISTRY_IMAGE}/labsync-builder:main
|
DOCKER_IMAGE_BUILDER: ${CI_REGISTRY_IMAGE}/labsync-builder:$CI_COMMIT_REF_SLUG
|
||||||
DOCKER_IMAGE_SECURITY_SCANNER: ${CI_REGISTRY_IMAGE}/security-scanner:main
|
DOCKER_IMAGE_SECURITY_SCANNER: ${CI_REGISTRY_IMAGE}/security-scanner:$CI_COMMIT_REF_SLUG
|
||||||
DOCKER_TLS_CERTDIR: ""
|
DOCKER_TLS_CERTDIR: ""
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
|
|
@ -21,26 +21,17 @@ dockerimage_builder:
|
||||||
- apk add --no-cache make
|
- apk add --no-cache make
|
||||||
services:
|
services:
|
||||||
- docker:dind
|
- docker:dind
|
||||||
variables:
|
|
||||||
DOCKER_IMAGE_BUILDER: ${CI_REGISTRY_IMAGE}/labsync-builder:$CI_COMMIT_REF_SLUG
|
|
||||||
script:
|
script:
|
||||||
- docker pull $DOCKER_IMAGE_BUILDER || true
|
- docker pull $DOCKER_IMAGE_BUILDER || true
|
||||||
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
|
||||||
- make builderimg
|
- make builderimg
|
||||||
- docker push $DOCKER_IMAGE_BUILDER
|
- docker push $DOCKER_IMAGE_BUILDER
|
||||||
- echo "DOCKER_IMAGE_BUILDER=$DOCKER_IMAGE_BUILDER" >> build.env
|
tags:
|
||||||
artifacts:
|
- fablab
|
||||||
reports:
|
- ssd
|
||||||
dotenv: build.env
|
except:
|
||||||
rules:
|
refs:
|
||||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
- schedules
|
||||||
when: on_success
|
|
||||||
- if:
|
|
||||||
changes:
|
|
||||||
paths:
|
|
||||||
- builder/**/*
|
|
||||||
compare_to: main
|
|
||||||
when: on_success
|
|
||||||
|
|
||||||
dockerimage_security_scanner:
|
dockerimage_security_scanner:
|
||||||
stage: prepare
|
stage: prepare
|
||||||
|
|
@ -50,22 +41,15 @@ dockerimage_security_scanner:
|
||||||
- docker:dind
|
- docker:dind
|
||||||
script:
|
script:
|
||||||
- docker pull $DOCKER_IMAGE_SECURITY_SCANNER || true
|
- docker pull $DOCKER_IMAGE_SECURITY_SCANNER || true
|
||||||
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
|
||||||
- make secscanimg
|
- make secscanimg
|
||||||
- docker push $DOCKER_IMAGE_SECURITY_SCANNER
|
- docker push $DOCKER_IMAGE_SECURITY_SCANNER
|
||||||
- echo "DOCKER_IMAGE_SECURITY_SCANNER=${CI_REGISTRY_IMAGE}/security-scanner:$CI_COMMIT_REF_SLUG" >> build.env
|
tags:
|
||||||
artifacts:
|
- fablab
|
||||||
reports:
|
- ssd
|
||||||
dotenv: build.env
|
except:
|
||||||
rules:
|
refs:
|
||||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
- schedules
|
||||||
when: on_success
|
|
||||||
- if:
|
|
||||||
changes:
|
|
||||||
paths:
|
|
||||||
- security-scanner/**/*
|
|
||||||
compare_to: main
|
|
||||||
when: on_success
|
|
||||||
|
|
||||||
security_scanner:
|
security_scanner:
|
||||||
stage: check
|
stage: check
|
||||||
|
|
@ -73,7 +57,7 @@ security_scanner:
|
||||||
script:
|
script:
|
||||||
- set -x
|
- set -x
|
||||||
- export GITLAB_URL="$(echo "$CI_PROJECT_URL" | grep -Eo '^https?://[^/]*')"
|
- export GITLAB_URL="$(echo "$CI_PROJECT_URL" | grep -Eo '^https?://[^/]*')"
|
||||||
- /code/venv/bin/python -m security_scanner $target
|
- python3 -m security_scanner $target
|
||||||
only:
|
only:
|
||||||
refs:
|
refs:
|
||||||
- schedules
|
- schedules
|
||||||
|
|
@ -81,17 +65,8 @@ security_scanner:
|
||||||
variables:
|
variables:
|
||||||
- $task == "security-scanner"
|
- $task == "security-scanner"
|
||||||
- $target
|
- $target
|
||||||
|
tags:
|
||||||
lightburn-download:
|
- dedicated
|
||||||
stage: prepare
|
|
||||||
image: alpine
|
|
||||||
script:
|
|
||||||
- mkdir -p packer/ansible/roles/lightburn/files
|
|
||||||
- 'wget -O packer/ansible/roles/lightburn/files/lightburn.zip --header "JOB-TOKEN: $CI_JOB_TOKEN" "${CI_SERVER_URL}/api/v4/projects/fablab%2Flightburn-patched/jobs/artifacts/main/download?job=patch-Linux64"'
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- packer/ansible/roles/lightburn/files/lightburn.zip
|
|
||||||
expire_in: 4 hours
|
|
||||||
|
|
||||||
.squashfs_template: &squashfs_template
|
.squashfs_template: &squashfs_template
|
||||||
image: $DOCKER_IMAGE_BUILDER
|
image: $DOCKER_IMAGE_BUILDER
|
||||||
|
|
@ -99,9 +74,7 @@ lightburn-download:
|
||||||
services:
|
services:
|
||||||
- docker:dind
|
- docker:dind
|
||||||
script:
|
script:
|
||||||
- echo DOCKER_IMAGE_BUILDER=$DOCKER_IMAGE_BUILDER
|
- scripts/packer.sh debian-bullseye
|
||||||
- echo DOCKER_IMAGE_SECURITY_SCANNER=$DOCKER_IMAGE_SECURITY_SCANNER
|
|
||||||
- scripts/packer.sh debian-bookworm
|
|
||||||
- aws --endpoint-url "$AWS_ENDPOINT_URL" s3 cp images/ "s3://$AWS_BUCKET/$CI_COMMIT_REF_SLUG/$CI_JOB_ID/" --recursive --no-progress
|
- aws --endpoint-url "$AWS_ENDPOINT_URL" s3 cp images/ "s3://$AWS_BUCKET/$CI_COMMIT_REF_SLUG/$CI_JOB_ID/" --recursive --no-progress
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
|
|
@ -111,6 +84,9 @@ lightburn-download:
|
||||||
- images/*.linux
|
- images/*.linux
|
||||||
#- images/*.squashfs
|
#- images/*.squashfs
|
||||||
- images/*.torrent
|
- images/*.torrent
|
||||||
|
tags:
|
||||||
|
- fablab
|
||||||
|
- ssd
|
||||||
|
|
||||||
squashfs_featurebranch:
|
squashfs_featurebranch:
|
||||||
<<: *squashfs_template
|
<<: *squashfs_template
|
||||||
|
|
|
||||||
30
Makefile
30
Makefile
|
|
@ -22,7 +22,7 @@ qemu_network = 10.2.2.0
|
||||||
qemu_netmask = 24
|
qemu_netmask = 24
|
||||||
qemu_vm_ip = 10.2.2.10
|
qemu_vm_ip = 10.2.2.10
|
||||||
qemu_disk = tmp/qemu-disk.img
|
qemu_disk = tmp/qemu-disk.img
|
||||||
qemu_target ?= debian-bookworm
|
qemu_target ?= debian-bullseye
|
||||||
qemu_kernel = $(qemu_target).linux
|
qemu_kernel = $(qemu_target).linux
|
||||||
qemu_torrent = $(qemu_target).torrent
|
qemu_torrent = $(qemu_target).torrent
|
||||||
qemu_initramfs = $(shell \
|
qemu_initramfs = $(shell \
|
||||||
|
|
@ -35,7 +35,7 @@ fi \
|
||||||
ci_environment=$(shell env | sed -n 's/^\(CI_.*\)=.*/-e \1/p')
|
ci_environment=$(shell env | sed -n 's/^\(CI_.*\)=.*/-e \1/p')
|
||||||
|
|
||||||
.PHONY: default
|
.PHONY: default
|
||||||
default: builderimg images/debian-bookworm.squashfs
|
default: builderimg images/debian-bullseye.squashfs
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
|
@ -60,7 +60,7 @@ images:
|
||||||
[ ! -d "$@" ] && mkdir "$@"
|
[ ! -d "$@" ] && mkdir "$@"
|
||||||
touch "$@"
|
touch "$@"
|
||||||
|
|
||||||
images/debian-bookworm.squashfs: images
|
images/debian-bullseye.squashfs: images
|
||||||
docker run \
|
docker run \
|
||||||
--rm \
|
--rm \
|
||||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||||
|
|
@ -72,9 +72,9 @@ images/debian-bookworm.squashfs: images
|
||||||
$(ci_environment) \
|
$(ci_environment) \
|
||||||
"$(DOCKER_IMAGE_BUILDER)" \
|
"$(DOCKER_IMAGE_BUILDER)" \
|
||||||
scripts/packer.sh \
|
scripts/packer.sh \
|
||||||
debian-bookworm
|
debian-bullseye
|
||||||
|
|
||||||
images/debian-bookworm.torrent: images
|
images/debian-bullseye.torrent: images
|
||||||
docker run \
|
docker run \
|
||||||
--rm \
|
--rm \
|
||||||
-v "${PWD}:${PWD}" \
|
-v "${PWD}:${PWD}" \
|
||||||
|
|
@ -82,7 +82,7 @@ images/debian-bookworm.torrent: images
|
||||||
-e "WEBSEED=$(WEBSEED)" \
|
-e "WEBSEED=$(WEBSEED)" \
|
||||||
"$(DOCKER_IMAGE_BUILDER)" \
|
"$(DOCKER_IMAGE_BUILDER)" \
|
||||||
scripts/torrent.sh \
|
scripts/torrent.sh \
|
||||||
debian-bookworm
|
debian-bullseye
|
||||||
|
|
||||||
.PHONY: ansible
|
.PHONY: ansible
|
||||||
ansible:
|
ansible:
|
||||||
|
|
@ -104,24 +104,24 @@ ansible:
|
||||||
|
|
||||||
# updates the initramfs
|
# updates the initramfs
|
||||||
# only used for development
|
# only used for development
|
||||||
images/debian-bookworm.initramfs.dev: tmp/initramfs-extracted/debian-bookworm packer/initramfs/labsync
|
images/debian-bullseye.initramfs.dev: tmp/initramfs-extracted/debian-bullseye packer/initramfs/labsync
|
||||||
cp packer/initramfs/labsync tmp/initramfs-extracted/debian-bookworm/scripts/labsync
|
cp packer/initramfs/labsync tmp/initramfs-extracted/debian-bullseye/scripts/labsync
|
||||||
(cd tmp/initramfs-extracted/debian-bookworm && find . | cpio -H newc -o | gzip > $(CWD)/images/debian-bookworm.initramfs.dev)
|
(cd tmp/initramfs-extracted/debian-bullseye && find . | cpio -H newc -o | gzip > $(CWD)/images/debian-bullseye.initramfs.dev)
|
||||||
|
|
||||||
tmp:
|
tmp:
|
||||||
[ ! -d "$@" ] && mkdir "$@" || true
|
[ ! -d "$@" ] && mkdir "$@" || true
|
||||||
|
|
||||||
tmp/initramfs-extracted/debian-bookworm: images/debian-bookworm.initramfs
|
tmp/initramfs-extracted/debian-bullseye: images/debian-bullseye.initramfs
|
||||||
rm -rf tmp/initramfs-extracted/debian-bookworm
|
rm -rf tmp/initramfs-extracted/debian-bullseye
|
||||||
mkdir -p tmp/initramfs-extracted/debian-bookworm
|
mkdir -p tmp/initramfs-extracted/debian-bullseye
|
||||||
(cd tmp/initramfs-extracted/debian-bookworm && zcat "$(CWD)/images/debian-bookworm.initramfs" | cpio -i)
|
(cd tmp/initramfs-extracted/debian-bullseye && zcat "$(CWD)/images/debian-bullseye.initramfs" | cpio -i)
|
||||||
touch tmp/initramfs-extracted/debian-bookworm
|
touch tmp/initramfs-extracted/debian-bullseye
|
||||||
|
|
||||||
$(qemu_disk): tmp
|
$(qemu_disk): tmp
|
||||||
qemu-img create "$@" 20G
|
qemu-img create "$@" 20G
|
||||||
|
|
||||||
tmp/netboot.tar.gz: tmp
|
tmp/netboot.tar.gz: tmp
|
||||||
wget -c -O "$@" https://cdn-aws.deb.debian.org/debian/dists/bookworm/main/installer-amd64/current/images/netboot/netboot.tar.gz
|
wget -c -O "$@" https://cdn-aws.deb.debian.org/debian/dists/bullseye/main/installer-amd64/current/images/netboot/netboot.tar.gz
|
||||||
touch "$@"
|
touch "$@"
|
||||||
|
|
||||||
tmp/tftproot: tmp/netboot.tar.gz
|
tmp/tftproot: tmp/netboot.tar.gz
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,6 @@
|
||||||
- role: firefox
|
- role: firefox
|
||||||
- role: windowmanager
|
- role: windowmanager
|
||||||
- role: inkscape
|
- role: inkscape
|
||||||
- role: lightburn
|
|
||||||
- role: prusa-slicer
|
|
||||||
- role: fablab
|
- role: fablab
|
||||||
- role: hardware
|
- role: hardware
|
||||||
- role: docker
|
- role: docker
|
||||||
|
|
@ -46,18 +44,65 @@
|
||||||
version: 3.3.1
|
version: 3.3.1
|
||||||
lightburn:
|
lightburn:
|
||||||
dockerimage: r.jalr.de/fablab/lightburn
|
dockerimage: r.jalr.de/fablab/lightburn
|
||||||
|
prusa_slicer:
|
||||||
|
settings: |
|
||||||
|
no_controller = 1
|
||||||
|
no_defaults = 1
|
||||||
|
preset_update = 0
|
||||||
|
show_splash_screen = 0
|
||||||
|
use_inches = 0
|
||||||
|
version_check = 0
|
||||||
|
view_mode = expert
|
||||||
|
|
||||||
|
[filaments]
|
||||||
|
AmazonBasics TPU @MINI = 1
|
||||||
|
Das Filament PLA = 1
|
||||||
|
Generic PETG = 1
|
||||||
|
Generic PETG @MINI = 1
|
||||||
|
Generic PETG @MMU2 = 1
|
||||||
|
Generic PLA = 1
|
||||||
|
Generic PLA @MMU2 = 1
|
||||||
|
Prusament ASA = 1
|
||||||
|
Prusament ASA @MINI = 1
|
||||||
|
Prusament ASA @MMU2 = 1
|
||||||
|
Prusament PC Blend = 1
|
||||||
|
Prusament PC Blend @MINI = 1
|
||||||
|
Prusament PC Blend @MMU2 = 1
|
||||||
|
Prusament PETG = 1
|
||||||
|
Prusament PETG @MINI = 1
|
||||||
|
Prusament PETG @MMU2 = 1
|
||||||
|
Prusament PLA = 1
|
||||||
|
Prusament PLA @MMU2 = 1
|
||||||
|
Prusament PVB = 1
|
||||||
|
Prusament PVB @MMU2 = 1
|
||||||
|
Verbatim BVOH = 1
|
||||||
|
Verbatim BVOH @MMU2 = 1
|
||||||
|
|
||||||
|
[presets]
|
||||||
|
filament = Prusament PLA
|
||||||
|
physical_printer =
|
||||||
|
print = 0.15mm QUALITY @MK3
|
||||||
|
printer = Original Prusa i3 MK3
|
||||||
|
sla_material =
|
||||||
|
sla_print =
|
||||||
|
|
||||||
|
[vendor:PrusaResearch]
|
||||||
|
model:MK3 = 0.4
|
||||||
|
model:MK3SMMU2S = 0.4
|
||||||
firefox:
|
firefox:
|
||||||
language_packs:
|
language_packs:
|
||||||
- de
|
- de
|
||||||
extensions:
|
extensions:
|
||||||
- uBlock0@raymondhill.net
|
- uBlock0@raymondhill.net
|
||||||
|
- https-everywhere@eff.org
|
||||||
debian_sections:
|
debian_sections:
|
||||||
- main
|
- main
|
||||||
- contrib
|
- contrib
|
||||||
- non-free
|
- non-free
|
||||||
debian_mirror: http://ftp.de.debian.org/debian
|
debian_mirror: http://ftp.de.debian.org/debian
|
||||||
hardware:
|
hardware:
|
||||||
firmware: []
|
firmware:
|
||||||
|
- firmware-amd-graphics
|
||||||
greeting:
|
greeting:
|
||||||
title: Willkommen im FabLab Bad Windsheim
|
title: Willkommen im FabLab Bad Windsheim
|
||||||
content: >
|
content: >
|
||||||
|
|
@ -66,56 +111,3 @@
|
||||||
Du hast Dich mit einem Gast-Account angemeldet. Alle Daten werden nach
|
Du hast Dich mit einem Gast-Account angemeldet. Alle Daten werden nach
|
||||||
der Anmeldung gelöscht. Wenn Du Deine Daten dauerhaft speichern
|
der Anmeldung gelöscht. Wenn Du Deine Daten dauerhaft speichern
|
||||||
möchtest, lege Dir bitte einen Account an!
|
möchtest, lege Dir bitte einen Account an!
|
||||||
lightburn:
|
|
||||||
devices:
|
|
||||||
- https://raw.githubusercontent.com/fablab-nea/LaserKutter/main/lightburn/LaserKutter.lbdev
|
|
||||||
prusa_slicer:
|
|
||||||
settings: |
|
|
||||||
no_controller = 1
|
|
||||||
no_defaults = 1
|
|
||||||
preset_update = 0
|
|
||||||
show_splash_screen = 0
|
|
||||||
use_inches = 0
|
|
||||||
version_check = 0
|
|
||||||
view_mode = expert
|
|
||||||
tls_accepted_cert_store_location = /etc/ssl/certs/ca-certificates.crt
|
|
||||||
tls_cert_store_accepted = yes
|
|
||||||
|
|
||||||
[filaments]
|
|
||||||
AmazonBasics TPU @MINI = 1
|
|
||||||
Das Filament PLA = 1
|
|
||||||
Generic PETG = 1
|
|
||||||
Generic PETG @MINI = 1
|
|
||||||
Generic PETG @MMU2 = 1
|
|
||||||
Generic PLA = 1
|
|
||||||
Generic PLA @MMU2 = 1
|
|
||||||
Prusament ASA = 1
|
|
||||||
Prusament ASA @MINI = 1
|
|
||||||
Prusament ASA @MMU2 = 1
|
|
||||||
Prusament PC Blend = 1
|
|
||||||
Prusament PC Blend @MINI = 1
|
|
||||||
Prusament PC Blend @MMU2 = 1
|
|
||||||
Prusament PETG = 1
|
|
||||||
Prusament PETG @MINI = 1
|
|
||||||
Prusament PETG @MMU2 = 1
|
|
||||||
Prusament PLA = 1
|
|
||||||
Prusament PLA @MMU2 = 1
|
|
||||||
Prusament PVB = 1
|
|
||||||
Prusament PVB @MMU2 = 1
|
|
||||||
Verbatim BVOH = 1
|
|
||||||
Verbatim BVOH @MMU2 = 1
|
|
||||||
|
|
||||||
[presets]
|
|
||||||
filament = Prusament PLA
|
|
||||||
physical_printer =
|
|
||||||
print = 0.15mm QUALITY @MK3
|
|
||||||
printer = Original Prusa i3 MK3
|
|
||||||
sla_material =
|
|
||||||
sla_print =
|
|
||||||
|
|
||||||
[vendor:PrusaResearch]
|
|
||||||
model:MK3 = 0.4
|
|
||||||
model:MK3SMMU2S = 0.4
|
|
||||||
|
|
||||||
[vendor:Ultimaker]
|
|
||||||
model:ULTIMAKER2 = 0.4
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
[Desktop Entry]
|
||||||
|
Name=LightBurn
|
||||||
|
GenericName=LightBurn
|
||||||
|
Comment=Laser Cutter Job Control Application
|
||||||
|
Exec=x-terminal-emulator -e 'sudo /usr/local/bin/lightburn'
|
||||||
|
Icon=/usr/local/share/lightburn/lightburn.png
|
||||||
|
Terminal=false
|
||||||
|
Type=Application
|
||||||
|
Categories=Graphics
|
||||||
34
packer/ansible/roles/fablab/files/lightburn/lightburn.sh
Executable file
34
packer/ansible/roles/fablab/files/lightburn/lightburn.sh
Executable file
|
|
@ -0,0 +1,34 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
. /etc/default/lightburn
|
||||||
|
|
||||||
|
if [ ! -z "$SUDO_COMMAND" ] && [ "$SUDO_COMMAND" = "$0" ]; then
|
||||||
|
home="$(getent passwd "$SUDO_UID" | cut -d: -f6)"
|
||||||
|
export PUID="$SUDO_UID"
|
||||||
|
export PGID="$SUDO_GID"
|
||||||
|
else
|
||||||
|
home="$HOME"
|
||||||
|
export PUID=$(id -u)
|
||||||
|
export PGID=$(id -g)
|
||||||
|
fi
|
||||||
|
|
||||||
|
config_dir="$home/.config/lightburn"
|
||||||
|
|
||||||
|
mkdir -p "$config_dir"
|
||||||
|
|
||||||
|
media="/media/$(id -un $PUID)"
|
||||||
|
if [ -e "$media" ]; then
|
||||||
|
media_volume="-v $media:/media"
|
||||||
|
fi
|
||||||
|
|
||||||
|
docker run \
|
||||||
|
--rm \
|
||||||
|
-e PUID \
|
||||||
|
-e PGID \
|
||||||
|
-e DISPLAY \
|
||||||
|
-v /tmp/.X11-unix/:/tmp/.X11-unix/ \
|
||||||
|
-v $config_dir:/config/ \
|
||||||
|
-v $home:/workdir/ \
|
||||||
|
$media_volume \
|
||||||
|
--network=none \
|
||||||
|
"$LIGHTBURN_DOCKER_IMAGE"
|
||||||
66
packer/ansible/roles/fablab/tasks/lightburn.yml
Normal file
66
packer/ansible/roles/fablab/tasks/lightburn.yml
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
---
|
||||||
|
- file:
|
||||||
|
path: /usr/local/share/lightburn
|
||||||
|
state: directory
|
||||||
|
mode: "0755"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
|
||||||
|
- name: copy icon
|
||||||
|
copy:
|
||||||
|
src: lightburn/lightburn.png
|
||||||
|
dest: /usr/local/share/lightburn/lightburn.png
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: copy script
|
||||||
|
copy:
|
||||||
|
src: lightburn/lightburn.sh
|
||||||
|
dest: /usr/local/bin/lightburn
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0755"
|
||||||
|
|
||||||
|
- name: add lightburn configuration
|
||||||
|
template:
|
||||||
|
src: lightburn/lightburn.j2
|
||||||
|
dest: /etc/default/lightburn
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: add lightburn to applications menu
|
||||||
|
copy:
|
||||||
|
src: lightburn/lightburn.desktop
|
||||||
|
dest: /usr/share/applications/lightburn.desktop
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: add group
|
||||||
|
group:
|
||||||
|
name: lightburn
|
||||||
|
system: yes
|
||||||
|
|
||||||
|
- name: add sudoers config
|
||||||
|
copy:
|
||||||
|
content: "%lightburn ALL=/usr/local/bin/lightburn, NOPASSWD:/usr/local/bin/lightburn\n"
|
||||||
|
dest: /etc/sudoers.d/lightburn
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: ensure guest-account settings directory exists
|
||||||
|
file:
|
||||||
|
path: /etc/guest-account
|
||||||
|
state: directory
|
||||||
|
mode: "0755"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
|
||||||
|
- name: add lightburn group to guest account
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/guest-account/groups
|
||||||
|
line: lightburn
|
||||||
|
create: yes
|
||||||
|
|
@ -18,8 +18,14 @@
|
||||||
- import_tasks: visicut.yml
|
- import_tasks: visicut.yml
|
||||||
tags:
|
tags:
|
||||||
- fablab:visicut
|
- fablab:visicut
|
||||||
# - import_tasks: platformio.yml
|
- import_tasks: lightburn.yml
|
||||||
# tags:
|
tags:
|
||||||
# - fablab:platformio
|
- fablab:lightburn
|
||||||
|
- import_tasks: prusa.yml
|
||||||
|
tags:
|
||||||
|
- fablab:prusa
|
||||||
|
- import_tasks: platformio.yml
|
||||||
|
tags:
|
||||||
|
- fablab:platformio
|
||||||
tags:
|
tags:
|
||||||
- fablab
|
- fablab
|
||||||
|
|
|
||||||
25
packer/ansible/roles/fablab/tasks/prusa.yml
Normal file
25
packer/ansible/roles/fablab/tasks/prusa.yml
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
---
|
||||||
|
- name: install slic3r-prusa
|
||||||
|
apt:
|
||||||
|
name: slic3r-prusa
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: create skel directories
|
||||||
|
file:
|
||||||
|
path: "/etc/skel/{{ item }}"
|
||||||
|
state: directory
|
||||||
|
loop:
|
||||||
|
- .config
|
||||||
|
- .config/PrusaSlicer
|
||||||
|
- .config/PrusaSlicer/vendor
|
||||||
|
|
||||||
|
- name: create symlink to vendor profiles
|
||||||
|
file:
|
||||||
|
src: /usr/share/PrusaSlicer/profiles/PrusaResearch.ini
|
||||||
|
dest: /etc/skel/.config/PrusaSlicer/vendor/PrusaResearch.ini
|
||||||
|
state: link
|
||||||
|
|
||||||
|
- name: Copy Prusa slicer settings
|
||||||
|
copy:
|
||||||
|
content: "{{ fablab.prusa_slicer.settings }}"
|
||||||
|
dest: /etc/skel/.config/PrusaSlicer/PrusaSlicer.ini
|
||||||
1
packer/ansible/roles/fablab/templates/lightburn/lightburn.j2
Executable file
1
packer/ansible/roles/fablab/templates/lightburn/lightburn.j2
Executable file
|
|
@ -0,0 +1 @@
|
||||||
|
LIGHTBURN_DOCKER_IMAGE='{{ fablab.lightburn.dockerimage }}'
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
"NoDefaultBookmarks": true,
|
"NoDefaultBookmarks": true,
|
||||||
"OfferToSaveLogins": true,
|
"OfferToSaveLogins": true,
|
||||||
"Homepage": {
|
"Homepage": {
|
||||||
"URL": "https://wiki.fablab-nea.de/"
|
"URL": "about:blank"
|
||||||
},
|
},
|
||||||
"OverrideFirstRunPage": "",
|
"OverrideFirstRunPage": "",
|
||||||
"SearchEngines": {
|
"SearchEngines": {
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,5 @@
|
||||||
- import_tasks: google.yml
|
- import_tasks: google.yml
|
||||||
tags:
|
tags:
|
||||||
- fonts:google
|
- fonts:google
|
||||||
- name: Install font viewer
|
|
||||||
apt:
|
|
||||||
name:
|
|
||||||
- fontmatrix
|
|
||||||
tags:
|
|
||||||
- fonts:fontmatrix
|
|
||||||
tags:
|
tags:
|
||||||
- fonts
|
- fonts
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 2f40eef85264eb6646ea7e89cbd4659560b88235
|
Subproject commit 05d9c57336b13028c01c5bfd850431708c934016
|
||||||
1
packer/ansible/roles/lightburn/.gitignore
vendored
1
packer/ansible/roles/lightburn/.gitignore
vendored
|
|
@ -1 +0,0 @@
|
||||||
*.zip
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
[Desktop Entry]
|
|
||||||
Name=LightBurn
|
|
||||||
Exec=/opt/LightBurn/LightBurn
|
|
||||||
Icon=/opt/LightBurn/LightBurn.png
|
|
||||||
Type=Application
|
|
||||||
Categories=Graphics;VectorGraphics;Engineering;
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
- name: Download devices files
|
|
||||||
uri:
|
|
||||||
url: "{{ device_url }}"
|
|
||||||
return_content: true
|
|
||||||
loop: "{{ lightburn.devices }}"
|
|
||||||
loop_control:
|
|
||||||
loop_var: device_url
|
|
||||||
register: lightburn_downloaded_devices
|
|
||||||
|
|
||||||
- name: Create lightburn settings
|
|
||||||
set_fact:
|
|
||||||
lightburn_devices: "{{ lightburn_devices | default([]) + [device_settings] }}"
|
|
||||||
vars:
|
|
||||||
device_settings: "{{ (device.content | from_json)['DeviceList'][0] }}"
|
|
||||||
loop: "{{ lightburn_downloaded_devices.results }}"
|
|
||||||
loop_control:
|
|
||||||
loop_var: device
|
|
||||||
label: "{{ device_settings.DisplayName }}"
|
|
||||||
|
|
||||||
- name: Create settings directory
|
|
||||||
file:
|
|
||||||
path: "{{ item }}"
|
|
||||||
state: directory
|
|
||||||
loop:
|
|
||||||
- /etc/skel/.config
|
|
||||||
- /etc/skel/.config/LightBurn
|
|
||||||
|
|
||||||
- name: Create settings file
|
|
||||||
copy:
|
|
||||||
dest: /etc/skel/.config/LightBurn/prefs.ini
|
|
||||||
content: "{{ lightburn_settings | to_nice_json() }}"
|
|
||||||
vars:
|
|
||||||
lightburn_settings:
|
|
||||||
DeviceList: "{{ lightburn_devices }}"
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
---
|
|
||||||
- name: Extract zip file
|
|
||||||
unarchive:
|
|
||||||
src: lightburn.zip
|
|
||||||
dest: /opt
|
|
||||||
- name: Create applications directory
|
|
||||||
file:
|
|
||||||
path: /usr/local/share/applications/
|
|
||||||
state: directory
|
|
||||||
- name: Copy desktop file
|
|
||||||
copy:
|
|
||||||
src: lightburn.desktop
|
|
||||||
dest: /usr/local/share/applications/lightburn.desktop
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
---
|
|
||||||
- block:
|
|
||||||
- import_tasks: install.yml
|
|
||||||
tags:
|
|
||||||
- lightburn:install
|
|
||||||
- import_tasks: devices.yml
|
|
||||||
tags:
|
|
||||||
- lightburn:devices
|
|
||||||
tags:
|
|
||||||
- lightburn
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
---
|
|
||||||
prusa_slicer_use_package: false
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
[Desktop Entry]
|
|
||||||
Name=Prusa GCode viewer
|
|
||||||
Exec=/opt/PrusaSlicer/bin/prusa-slicer --gcodeviewer %F
|
|
||||||
Icon=/opt/PrusaSlicer/resources/icons/PrusaSlicer-gcodeviewer.svg
|
|
||||||
Terminal=false
|
|
||||||
Type=Application
|
|
||||||
MimeType=text/x.gcode;
|
|
||||||
Categories=Graphics;3DGraphics;
|
|
||||||
Keywords=3D;Printing;Slicer;
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
[Desktop Entry]
|
|
||||||
Name=PrusaSlicer
|
|
||||||
GenericName=3D Printing Software
|
|
||||||
Terminal=false
|
|
||||||
Exec=/opt/PrusaSlicer/bin/prusa-slicer %F
|
|
||||||
Icon=/opt/PrusaSlicer/resources/icons/PrusaSlicer.png
|
|
||||||
Type=Application
|
|
||||||
MimeType=model/stl;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;application/x-amf;
|
|
||||||
Categories=Graphics;3DGraphics;Engineering;
|
|
||||||
Keywords=3D;Printing;Slicer;slice;3D;printer;convert;gcode;stl;obj;amf;SLA
|
|
||||||
StartupNotify=false
|
|
||||||
StartupWMClass=prusa-slicer
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
||||||
---
|
|
||||||
- set_fact:
|
|
||||||
prusa_slicer_profiles_directory: /usr/share/PrusaSlicer/profiles
|
|
||||||
when: prusa_slicer_use_package | bool
|
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
prusa_slicer_profiles_directory: /opt/PrusaSlicer/resources/profiles
|
|
||||||
when: not prusa_slicer_use_package | bool
|
|
||||||
|
|
||||||
- name: create skel directories
|
|
||||||
file:
|
|
||||||
path: "/etc/skel/{{ item }}"
|
|
||||||
state: directory
|
|
||||||
loop:
|
|
||||||
- .config
|
|
||||||
- .config/PrusaSlicer
|
|
||||||
- .config/PrusaSlicer/vendor
|
|
||||||
|
|
||||||
- name: create symlink to vendor profiles
|
|
||||||
file:
|
|
||||||
src: "{{ prusa_slicer_profiles_directory }}/{{ item }}.ini"
|
|
||||||
dest: /etc/skel/.config/PrusaSlicer/vendor/{{ item }}.ini
|
|
||||||
state: link
|
|
||||||
loop:
|
|
||||||
- PrusaResearch
|
|
||||||
- Ultimaker
|
|
||||||
|
|
||||||
- name: Stat /opt/PrusaSlicer
|
|
||||||
stat:
|
|
||||||
path: /opt/PrusaSlicer
|
|
||||||
register: prusa_slicer_stat
|
|
||||||
|
|
||||||
- name: Set version
|
|
||||||
set_fact:
|
|
||||||
prusa_slicer_version: "{{ prusa_slicer_stat.stat.lnk_target | regex_replace('^/opt/PrusaSlicer-(.*)-[0-9]{12}$', '\\1') }}"
|
|
||||||
when: prusa_slicer_stat.stat.exists and prusa_slicer_stat.stat.islnk
|
|
||||||
|
|
||||||
- debug:
|
|
||||||
var: prusa_slicer_version
|
|
||||||
|
|
||||||
- name: Copy Prusa slicer settings
|
|
||||||
copy:
|
|
||||||
content: |
|
|
||||||
version_system_info_sent = {{ prusa_slicer_version | default('') }}
|
|
||||||
{{ prusa_slicer.settings }}
|
|
||||||
dest: /etc/skel/.config/PrusaSlicer/PrusaSlicer.ini
|
|
||||||
|
|
@ -1,60 +0,0 @@
|
||||||
---
|
|
||||||
- name: Get latest release
|
|
||||||
uri:
|
|
||||||
url: https://api.github.com/repos/prusa3d/PrusaSlicer/releases/latest
|
|
||||||
return_content: true
|
|
||||||
register: prusa_slicer_release
|
|
||||||
|
|
||||||
- name: Create tarball tempfile
|
|
||||||
tempfile:
|
|
||||||
state: file
|
|
||||||
suffix: .tar.gz
|
|
||||||
register: prusa_slicer_tarball
|
|
||||||
|
|
||||||
- name: Select asset
|
|
||||||
set_fact:
|
|
||||||
prusa_slicer_asset: "{{ asset }}"
|
|
||||||
when: "asset.name | regex_search('PrusaSlicer-.*linux-x64-GTK3.*\\.tar\\.bz2$')"
|
|
||||||
loop: "{{ prusa_slicer_release.json.assets }}"
|
|
||||||
loop_control:
|
|
||||||
loop_var: asset
|
|
||||||
label: "{{ asset.name }}"
|
|
||||||
|
|
||||||
- name: Download release file
|
|
||||||
get_url:
|
|
||||||
url: "{{ prusa_slicer_asset.browser_download_url }}"
|
|
||||||
dest: "{{ prusa_slicer_tarball.path }}"
|
|
||||||
force: true
|
|
||||||
|
|
||||||
- name: Extract tarball
|
|
||||||
unarchive:
|
|
||||||
src: "{{ prusa_slicer_tarball.path }}"
|
|
||||||
dest: /opt
|
|
||||||
remote_src: true
|
|
||||||
|
|
||||||
- name: Remove tarball
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "{{ prusa_slicer_tarball.path }}"
|
|
||||||
state: absent
|
|
||||||
when: prusa_slicer_tarball.path is defined
|
|
||||||
|
|
||||||
- name: Create symlink
|
|
||||||
file:
|
|
||||||
src: "/opt/{{ prusa_slicer_directory }}"
|
|
||||||
dest: "/opt/PrusaSlicer"
|
|
||||||
state: link
|
|
||||||
vars:
|
|
||||||
prusa_slicer_directory: "{{ prusa_slicer_asset.name | regex_replace('\\.tar\\.bz2$', '') }}"
|
|
||||||
|
|
||||||
- name: Create applications directory
|
|
||||||
file:
|
|
||||||
path: /usr/local/share/applications/
|
|
||||||
state: directory
|
|
||||||
|
|
||||||
- name: Copy desktop files
|
|
||||||
copy:
|
|
||||||
src: "{{ item }}.desktop"
|
|
||||||
dest: /usr/local/share/applications/{{ item }}.desktop
|
|
||||||
loop:
|
|
||||||
- PrusaSlicer
|
|
||||||
- PrusaGcodeviewer
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
---
|
|
||||||
- block:
|
|
||||||
- import_tasks: package.yml
|
|
||||||
when: prusa_slicer_use_package | bool
|
|
||||||
tags:
|
|
||||||
- prusa-slicer:install
|
|
||||||
|
|
||||||
- import_tasks: install_from_github.yml
|
|
||||||
when: not prusa_slicer_use_package | bool
|
|
||||||
tags:
|
|
||||||
- prusa-slicer:install
|
|
||||||
|
|
||||||
- import_tasks: configure.yml
|
|
||||||
tags:
|
|
||||||
- prusa-slicer:configure
|
|
||||||
|
|
||||||
tags:
|
|
||||||
- prusa-slicer
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
---
|
|
||||||
- name: install slic3r-prusa
|
|
||||||
apt:
|
|
||||||
name: slic3r-prusa
|
|
||||||
state: present
|
|
||||||
|
|
@ -20,7 +20,7 @@ variables:
|
||||||
|
|
||||||
builders:
|
builders:
|
||||||
- discard: true
|
- discard: true
|
||||||
image: debian:bookworm
|
image: debian:bullseye
|
||||||
type: docker
|
type: docker
|
||||||
volumes:
|
volumes:
|
||||||
'{{user `images`}}': /tmp/images
|
'{{user `images`}}': /tmp/images
|
||||||
|
|
@ -62,17 +62,16 @@ provisioners:
|
||||||
- cp $(find /boot/ -name 'vmlinuz-*' | sort -V | tail -n 1) '/tmp/images/{{user `linux_file`}}'
|
- cp $(find /boot/ -name 'vmlinuz-*' | sort -V | tail -n 1) '/tmp/images/{{user `linux_file`}}'
|
||||||
type: shell
|
type: shell
|
||||||
- inline:
|
- inline:
|
||||||
- apt-get -y install openssh-server python3 lsb-release
|
- apt-get -y install openssh-server python lsb-release
|
||||||
|
- mkdir -p /root/.ansible/tmp
|
||||||
type: shell
|
type: shell
|
||||||
- playbook_file: ansible/playbook.yml
|
- playbook_file: ansible/playbook.yml
|
||||||
type: ansible
|
type: ansible
|
||||||
user: root
|
user: "{{user `ssh_user`}}"
|
||||||
ansible_env_vars:
|
ansible_env_vars:
|
||||||
- "ANSIBLE_SSH_ARGS='-o HostkeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa'"
|
- "ANSIBLE_SSH_ARGS='-o HostkeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa'"
|
||||||
- "ANSIBLE_PYTHON_INTERPRETER=/usr/bin/python3"
|
- "ANSIBLE_PYTHON_INTERPRETER=/usr/bin/python3"
|
||||||
extra_arguments:
|
- "ANSIBLE_VERBOSITY=4"
|
||||||
- "--scp-extra-args"
|
|
||||||
- "'-O'"
|
|
||||||
- inline:
|
- inline:
|
||||||
- rm /boot && mkdir /boot
|
- rm /boot && mkdir /boot
|
||||||
type: shell
|
type: shell
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
FROM debian:bookworm-slim
|
FROM debian:bullseye-slim
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get -y install \
|
&& apt-get -y install \
|
||||||
|
|
@ -7,17 +7,14 @@ RUN apt-get update \
|
||||||
python3 \
|
python3 \
|
||||||
python3-apt \
|
python3-apt \
|
||||||
python3-pip \
|
python3-pip \
|
||||||
python3-venv \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY setup.py /code/setup.py
|
COPY setup.py /code/setup.py
|
||||||
|
|
||||||
WORKDIR /code
|
WORKDIR /code
|
||||||
|
|
||||||
RUN python3 -m venv --system-site-packages venv
|
RUN pip3 install -e .
|
||||||
|
|
||||||
RUN venv/bin/pip install -e .
|
|
||||||
|
|
||||||
ADD . /code
|
ADD . /code
|
||||||
|
|
||||||
RUN venv/bin/python setup.py install
|
RUN python3 setup.py install
|
||||||
|
|
|
||||||
4
txt.cfg
4
txt.cfg
|
|
@ -1,7 +1,7 @@
|
||||||
label labsync
|
label labsync
|
||||||
menu label ^labsync
|
menu label ^labsync
|
||||||
kernel images/debian-bookworm.linux
|
kernel images/debian-bullseye.linux
|
||||||
append initrd=images/debian-bookworm.initramfs.dev boot=labsync labsync_disk=sda labsync_partsize_boot=512 labsync_torrent=http://10.2.2.1/debian-bookworm.torrent quiet vga=792 ip=10.2.2.10:::255.255.255.0:qemu-host:ens3:off labsync_wait=pause
|
append initrd=images/debian-bullseye.initramfs.dev boot=labsync labsync_disk=sda labsync_partsize_boot=512 labsync_torrent=http://10.2.2.1/debian-bullseye.torrent quiet vga=792 ip=10.2.2.10:::255.255.255.0:qemu-host:ens3:off labsync_wait=pause
|
||||||
|
|
||||||
label install
|
label install
|
||||||
menu label ^Install
|
menu label ^Install
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue