-
Notifications
You must be signed in to change notification settings - Fork 0
Ubuntu desktop role #337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Ubuntu desktop role #337
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
660b8a8
Fix Gitea CLI install
bubacoder 3c0c96a
Add ubuntu_desktop Ansible role
bubacoder f7269f3
Move secret.yaml to config folder
bubacoder f6e6a9a
Add requirements.txt
bubacoder bafd6b9
Add uv as brew package
bubacoder 9bf5d74
Pin and audit python packages
bubacoder 99fde90
Update infra-mcp package lock
bubacoder 7a9db24
Verify checksum of Sunshine
bubacoder b6e0818
Add git global config for core.editor to use vim
bubacoder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,7 @@ | ||
| #!/bin/sh | ||
|
|
||
| cd "$(dirname "$0")" || exit | ||
| ansible-playbook "playbooks/cloud.yaml" "$@" | ||
| ansible-playbook "playbooks/cloud.yaml" \ | ||
| -i inventory/inventory.yaml \ | ||
| -i ../config/ansible/inventory/inventory.yaml \ | ||
| "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,8 @@ | ||
| #!/bin/sh | ||
|
|
||
| cd "$(dirname "$0")" || exit | ||
| ansible-playbook "playbooks/homelab.yaml" --limit "!local-debian,!azure-vm" "$@" | ||
| ansible-playbook "playbooks/homelab.yaml" \ | ||
| -i inventory/inventory.yaml \ | ||
| -i ../config/ansible/inventory/inventory.yaml \ | ||
| --limit "!local-debian,!azure-vm" \ | ||
| "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,10 @@ | ||
| #!/bin/sh | ||
|
|
||
| cd "$(dirname "$0")" || exit | ||
| ansible-playbook "playbooks/homelab.yaml" --limit "$(hostname)" \ | ||
| ansible-playbook "playbooks/homelab.yaml" \ | ||
| -i inventory/inventory.yaml \ | ||
| -i ../config/ansible/inventory/inventory.yaml \ | ||
| -e ansible_connection=local \ | ||
| -e ansible_pipelining=false \ | ||
| --limit "$(hostname)" \ | ||
|
bubacoder marked this conversation as resolved.
|
||
| "$@" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,3 +57,5 @@ | |
| value: "store" | ||
| - name: "pull.rebase" | ||
| value: "true" | ||
| - name: "core.editor" | ||
| value: "vim" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| --- | ||
| ubuntu_desktop_snap_packages: | ||
| - brave | ||
| - steam | ||
|
|
||
| ubuntu_desktop_snap_classic_packages: | ||
| - code | ||
|
|
||
| ubuntu_desktop_install_chrome: true | ||
|
|
||
| ubuntu_desktop_install_rustdesk: true | ||
| # renovate: datasource=github-releases depName=rustdesk/rustdesk | ||
| ubuntu_desktop_rustdesk_version: "1.4.6" | ||
|
|
||
| ubuntu_desktop_install_sunshine: false | ||
| # renovate: datasource=github-releases depName=LizardByte/Sunshine | ||
| ubuntu_desktop_sunshine_version: "v2026.516.143833" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| - name: Install snap packages | ||
| community.general.snap: | ||
| name: "{{ ubuntu_desktop_snap_packages }}" | ||
| state: present | ||
|
|
||
| - name: Install classic snap packages | ||
| community.general.snap: | ||
| name: "{{ item }}" | ||
| classic: true | ||
| state: present | ||
| loop: "{{ ubuntu_desktop_snap_classic_packages }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| --- | ||
| - name: Check if Chrome is installed | ||
| ansible.builtin.command: | ||
| cmd: dpkg-query -W -f='${Status}' google-chrome-stable | ||
| register: ubuntu_desktop_chrome_status | ||
| changed_when: false | ||
| failed_when: false | ||
|
|
||
| - name: Download Chrome .deb package | ||
| ansible.builtin.get_url: | ||
| url: https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | ||
| dest: /tmp/google-chrome-stable_current_amd64.deb | ||
| mode: "0644" | ||
| when: ubuntu_desktop_chrome_status.rc != 0 or 'install ok installed' not in ubuntu_desktop_chrome_status.stdout | ||
|
|
||
| - name: Install Chrome | ||
| ansible.builtin.apt: | ||
| deb: /tmp/google-chrome-stable_current_amd64.deb | ||
| state: present | ||
| when: ubuntu_desktop_chrome_status.rc != 0 or 'install ok installed' not in ubuntu_desktop_chrome_status.stdout | ||
|
|
||
| - name: Clean up Chrome .deb | ||
| ansible.builtin.file: | ||
| path: /tmp/google-chrome-stable_current_amd64.deb | ||
| state: absent | ||
| when: ubuntu_desktop_chrome_status.rc != 0 or 'install ok installed' not in ubuntu_desktop_chrome_status.stdout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| --- | ||
| - name: Check installed RustDesk version | ||
| ansible.builtin.command: | ||
| cmd: dpkg-query -W -f='${Version}' rustdesk | ||
| register: ubuntu_desktop_rustdesk_installed | ||
| changed_when: false | ||
| failed_when: false | ||
|
|
||
| - name: Download RustDesk .deb package | ||
| ansible.builtin.get_url: | ||
| url: "https://github.com/rustdesk/rustdesk/releases/download/{{ ubuntu_desktop_rustdesk_version }}/rustdesk-{{ ubuntu_desktop_rustdesk_version }}-x86_64.deb" | ||
| dest: /tmp/rustdesk.deb | ||
| mode: "0644" | ||
| when: ubuntu_desktop_rustdesk_installed.rc != 0 or ubuntu_desktop_rustdesk_installed.stdout != ubuntu_desktop_rustdesk_version | ||
|
|
||
| - name: Install RustDesk | ||
| ansible.builtin.apt: | ||
| deb: /tmp/rustdesk.deb | ||
| state: present | ||
| when: ubuntu_desktop_rustdesk_installed.rc != 0 or ubuntu_desktop_rustdesk_installed.stdout != ubuntu_desktop_rustdesk_version | ||
|
|
||
| - name: Clean up RustDesk .deb | ||
| ansible.builtin.file: | ||
| path: /tmp/rustdesk.deb | ||
| state: absent | ||
| when: ubuntu_desktop_rustdesk_installed.rc != 0 or ubuntu_desktop_rustdesk_installed.stdout != ubuntu_desktop_rustdesk_version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| --- | ||
| # URL uses ansible_facts['distribution_version'] for the Ubuntu release (e.g. 24.04) | ||
| # dpkg version strips the leading 'v' from the release tag | ||
| - name: Check installed Sunshine version | ||
| ansible.builtin.command: | ||
| cmd: dpkg-query -W -f='${Version}' sunshine | ||
| register: ubuntu_desktop_sunshine_installed | ||
| changed_when: false | ||
| failed_when: false | ||
|
|
||
| - name: Install Sunshine dependencies | ||
| ansible.builtin.apt: | ||
| pkg: | ||
| - miniupnpc | ||
| - libminiupnpc21 | ||
| state: present | ||
| when: ubuntu_desktop_sunshine_installed.rc != 0 or ubuntu_desktop_sunshine_installed.stdout != ubuntu_desktop_sunshine_version | regex_replace('^v', '') | ||
|
|
||
| - name: Fetch checksum release metadata | ||
| ansible.builtin.uri: | ||
| url: "https://api.github.com/repos/LizardByte/Sunshine/releases/tags/{{ ubuntu_desktop_sunshine_version }}" | ||
| return_content: true | ||
| headers: | ||
| Accept: "application/vnd.github+json" | ||
| register: ubuntu_desktop_sunshine_release | ||
| when: ubuntu_desktop_sunshine_installed.rc != 0 or ubuntu_desktop_sunshine_installed.stdout != ubuntu_desktop_sunshine_version | regex_replace('^v', '') | ||
|
|
||
| - name: Extract Sunshine checksum for this platform | ||
| ansible.builtin.set_fact: | ||
| ubuntu_desktop_sunshine_checksum: >- | ||
| sha256:{{ (ubuntu_desktop_sunshine_release.json.body | ||
| | regex_search('sunshine-ubuntu-' + ansible_facts['distribution_version'] + '-amd64[.]deb[^\n]*sha256:([a-f0-9]{64})', '\1')) | first }} | ||
| when: ubuntu_desktop_sunshine_installed.rc != 0 or ubuntu_desktop_sunshine_installed.stdout != ubuntu_desktop_sunshine_version | regex_replace('^v', '') | ||
|
|
||
| - name: Create temporary file for Sunshine .deb | ||
| ansible.builtin.tempfile: | ||
| suffix: .deb | ||
| register: ubuntu_desktop_sunshine_deb | ||
| when: ubuntu_desktop_sunshine_installed.rc != 0 or ubuntu_desktop_sunshine_installed.stdout != ubuntu_desktop_sunshine_version | regex_replace('^v', '') | ||
|
|
||
| - name: Download Sunshine .deb package | ||
| ansible.builtin.get_url: | ||
| url: "https://github.com/LizardByte/Sunshine/releases/download/{{ ubuntu_desktop_sunshine_version }}/sunshine-ubuntu-{{ ansible_facts['distribution_version'] }}-amd64.deb" | ||
| dest: "{{ ubuntu_desktop_sunshine_deb.path }}" | ||
| mode: "0644" | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| checksum: "{{ ubuntu_desktop_sunshine_checksum }}" | ||
| when: ubuntu_desktop_sunshine_installed.rc != 0 or ubuntu_desktop_sunshine_installed.stdout != ubuntu_desktop_sunshine_version | regex_replace('^v', '') | ||
|
|
||
| - name: Install Sunshine | ||
| ansible.builtin.apt: | ||
| deb: "{{ ubuntu_desktop_sunshine_deb.path }}" | ||
| state: present | ||
| when: ubuntu_desktop_sunshine_installed.rc != 0 or ubuntu_desktop_sunshine_installed.stdout != ubuntu_desktop_sunshine_version | regex_replace('^v', '') | ||
|
|
||
| - name: Clean up Sunshine .deb | ||
| ansible.builtin.file: | ||
| path: "{{ ubuntu_desktop_sunshine_deb.path }}" | ||
| state: absent | ||
| when: ubuntu_desktop_sunshine_installed.rc != 0 or ubuntu_desktop_sunshine_installed.stdout != ubuntu_desktop_sunshine_version | regex_replace('^v', '') | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| --- | ||
| - name: Install snap packages | ||
| ansible.builtin.import_tasks: 10-snap.yaml | ||
| become: true | ||
|
|
||
| - name: Install Chrome | ||
| ansible.builtin.import_tasks: 20-chrome.yaml | ||
| become: true | ||
| when: ubuntu_desktop_install_chrome | default(false) | ansible.builtin.bool | ||
|
|
||
| - name: Install RustDesk | ||
| ansible.builtin.import_tasks: 30-rustdesk.yaml | ||
| become: true | ||
| when: ubuntu_desktop_install_rustdesk | default(false) | ansible.builtin.bool | ||
|
|
||
| - name: Install Sunshine | ||
| ansible.builtin.import_tasks: 40-sunshine.yaml | ||
| become: true | ||
| when: ubuntu_desktop_install_sunshine | default(false) | ansible.builtin.bool |
10 changes: 10 additions & 0 deletions
10
config-example/ansible/inventory/group_vars/debian/secret.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
|
|
||
| # kics-scan ignore-line | ||
| admin_password: "XXX" | ||
|
bubacoder marked this conversation as resolved.
|
||
|
|
||
| # sha512_crypt requires <= 16 chars for salt. Generate with: | ||
| # tr -dc 'A-Za-z0-9./' < /dev/urandom | head -c 16 | ||
| password_salt: "XXX" | ||
|
|
||
| debian_base_crowdsec_local_api_key: "XXX" | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.