diff --git a/.gitignore b/.gitignore index 50635c3..0393e95 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ +/.vscode +/.idea /config/*.yaml pkglist.txt diff --git a/playbooks/roles/docker/tasks/main.yml b/playbooks/roles/docker/tasks/main.yml index baf24b9..8f44dce 100644 --- a/playbooks/roles/docker/tasks/main.yml +++ b/playbooks/roles/docker/tasks/main.yml @@ -10,7 +10,7 @@ - name: Add user to docker group user: - name: '{{ system.username }}' + name: "{{ system.username }}" groups: docker append: yes @@ -24,7 +24,7 @@ - name: Configure systemd-resolved to play well with dnsdock copy: - dest: '/etc/systemd/resolved.conf.d/docker-dev-dns.conf' + dest: "/etc/systemd/resolved.conf.d/docker-dev-dns.conf" content: | [Resolve] DNS=172.17.0.1 diff --git a/playbooks/roles/sparkfabrik/files/bin/jwt-decode b/playbooks/roles/sparkfabrik/files/bin/jwt-decode new file mode 100755 index 0000000..51dcf13 --- /dev/null +++ b/playbooks/roles/sparkfabrik/files/bin/jwt-decode @@ -0,0 +1,29 @@ +#!/bin/sh + +if [ -z "${1}" ]; then + echo "Usage: ${0} [piece]" + exit 1 +fi + +PIECE=2 +if [ -n "${2}" ]; then + PIECE="${2}" +fi + +if [ "${PIECE}" != "1" ] && [ "${PIECE}" != "2" ] && [ "${PIECE}" != "3" ]; then + echo "The piece option must be 1, 2, or 3" + echo "Usage: ${0} [piece]" + exit 2 +fi + +decode_base64_url() { + len=$((${#1} % 4)) + result="$1" + if [ $len -eq 2 ]; then result="$1"'==' + elif [ $len -eq 3 ]; then result="$1"'=' + fi + # echo "$result" | tr '_-' '/+' | openssl enc -d -base64 + echo "$result" | tr '_-' '/+' | base64 -d +} + +decode_base64_url "$(echo "${1}" | cut -d "." -f "${PIECE}")" diff --git a/playbooks/roles/sparkfabrik/tasks/main.yml b/playbooks/roles/sparkfabrik/tasks/main.yml index 4bdafe1..98883ad 100644 --- a/playbooks/roles/sparkfabrik/tasks/main.yml +++ b/playbooks/roles/sparkfabrik/tasks/main.yml @@ -3,24 +3,30 @@ tags: [vendor, sparkfabrik] when: sparkfabrik | default(false) block: - - name: Install wallpapers - synchronize: - src: wallpapers/ - dest: /usr/share/backgrounds/sparkfabrik - delete: no - recursive: yes + - name: Install wallpapers + synchronize: + src: wallpapers/ + dest: /usr/share/backgrounds/sparkfabrik + delete: no + recursive: yes - - name: Install wallpapers xml - copy: - src: gnome-spark-wallpapers.xml - dest: /usr/share/gnome-background-properties - - - name: Copy ayse-get-sm binary to print serial-number - copy: - src: "bin/ayse-get-sm" - dest: /usr/local/bin/ayse-get-sm - force: yes - mode: u+rwx,g-wx,o-rwx - owner: "{{ system.username }}" + - name: Install wallpapers xml + copy: + src: gnome-spark-wallpapers.xml + dest: /usr/share/gnome-background-properties + - name: Copy ayse-get-sm binary to print serial-number + copy: + src: "bin/ayse-get-sm" + dest: /usr/local/bin/ayse-get-sm + force: yes + mode: u+rwx,g-wx,o-rwx + owner: "{{ system.username }}" + - name: Copy jwt-decode script + copy: + src: "bin/jwt-decode" + dest: /usr/local/bin/jwt-decode + force: yes + mode: u+rwx,g-wx,o-rwx + owner: "{{ system.username }}"