From 0b99f6b73b121723476075df7e4f9b6eaea7e44e Mon Sep 17 00:00:00 2001 From: Guilherme Bufolo Date: Wed, 22 Jan 2025 21:58:59 +0100 Subject: [PATCH] Sets wallpaper, setup lightburn (not working) --- group_vars/all.yaml | 6 ++++++ pb_setup.yaml | 25 ++++++++++++++++++++----- tasks/set_wallpaper.yaml | 12 ++++++++++++ tasks/setup_lightburn.yaml | 24 ++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 5 deletions(-) create mode 100644 tasks/set_wallpaper.yaml create mode 100644 tasks/setup_lightburn.yaml diff --git a/group_vars/all.yaml b/group_vars/all.yaml index ff08d3d..711c710 100644 --- a/group_vars/all.yaml +++ b/group_vars/all.yaml @@ -1,4 +1,10 @@ +users: + - name: hobbyengel + password: start140 +wallpaper: ~/FABLAB FileCloud/IT-admin (don't touch!)/wallpaper/PNG/Hobbyhimmel_fablab-pc_wallpaper_1920x1200.png +default_groups: + - dialout # VS Code variables # https://github.com/avnes/ansible-role-vscode vscode_microsoft_asc_url: https://packages.microsoft.com/keys/microsoft.asc diff --git a/pb_setup.yaml b/pb_setup.yaml index 1b215c2..a86b83b 100644 --- a/pb_setup.yaml +++ b/pb_setup.yaml @@ -5,6 +5,19 @@ vars_files: secrets.yaml tasks: + + - name: Add users + user: + name: "{{ item.name }}" + password: "{{ item.password | password_hash('sha512') }}" + shell: "/bin/zsh" + loop: "{{ users }}" + - name: Add users to default groups + user: + groups: "{{ default_groups }}" + append: true + name: "{{ item.name }}" + loop: "{{ users }}" - name: Setup apt-transport-https (needed by Microsoft PPA) apt: name: apt-transport-https @@ -54,22 +67,24 @@ - com.prusa3d.PrusaSlicer - org.filezillaproject.Filezilla state: latest + - name: Install LightBurn + import_tasks: ./tasks/setup_lightburn.yaml - name: Setup OpenRobertaConnectior import_tasks: ./tasks/openrobertaconnector.yaml - name: cups_browserd deaktivieren import_tasks: ./tasks/disable_browsed.yaml - # done - name: Firefox installieren + - name: Wallpaper setzen + import_tasks: ./tasks/set_wallpaper.yaml + + +# done - name: Firefox installieren # - name: ublock Installieren # - name: DSGVO deny Installieren # - name: ecosia # - name: do not translate # - name: Fonts installieren # - name: Links zu Benutzerdaten in Nextcloud installieren - # - name: HobbyEngel und roberta anlegen - # - name: alle User in Dialout hinzufügen - # - name: Hintergrund setzen # - name: LaserSoftware installieren - # - name: Grafiktreiber installieren # Stop firefox from snap: https://balintreczey.hu/blog/firefox-on-ubuntu-22-04-from-deb-not-from-snap/ \ No newline at end of file diff --git a/tasks/set_wallpaper.yaml b/tasks/set_wallpaper.yaml new file mode 100644 index 0000000..dbb81e5 --- /dev/null +++ b/tasks/set_wallpaper.yaml @@ -0,0 +1,12 @@ +- name: Copy wallpaper file + copy: src={{wallpaper}} dest=/home/{{item.name}}/.wallpaper.jpg + loop: "{{users}}" +- name: Set GNOME Wallpaper + become_user: "{{user.name}}" + dconf: key="/org/gnome/desktop/background/picture-uri" value="'file:///home/{{user.name}}/.wallpaper.jpg'" + loop: "{{users}}" +- name: Set GNOME Wallpaper scale + become_user: "{{user.name}}" + dconf: key="/org/gnome/desktop/background/picture-options" value="'scaled'" + loop: "{{users}}" + \ No newline at end of file diff --git a/tasks/setup_lightburn.yaml b/tasks/setup_lightburn.yaml new file mode 100644 index 0000000..38f6293 --- /dev/null +++ b/tasks/setup_lightburn.yaml @@ -0,0 +1,24 @@ +- become: yes + hosts: all + vars_files: secrets.yaml + tasks: + - block: + - name: Create folder for LightBurn + file: + path: ~/lightburn + state: directory + - name: Get latest version + uri: + url: "https://github.com/LightBurnSoftware/deployment/raw/refs/heads/master/currentversion.json" + return_content: true + register: lb_latest + - name: Download latest + loop: "{{lb_latest}}" + when: unix64_app in item + get_url: + dest: ~/lightburn/ + url: "{{item.file}}" + vars: + - ansible_become_user: "{{users[0].name}}" + - ansible_become_password: "{{users[0].password}}" +