Tailscale - Create template and install service

This commit is contained in:
unman 2025-04-11 13:36:44 +00:00
parent ea8008c94f
commit f629df4a4c
No known key found for this signature in database
GPG Key ID: FDD1B8244731B36C
4 changed files with 116 additions and 0 deletions

20
tailscale/create.sls Normal file
View File

@ -0,0 +1,20 @@
qvm-present-tailscale:
qvm.present:
- name: sys-tailscale
- class: AppVM
- template: template-tailscale
- label: green
qvm-prefs-tailscale:
qvm.prefs:
- name: sys-tailscale
- memory: 400
- maxmem: 4000
- vcpus: 2
- provides-network: True
qvm-features-tailscale:
qvm.features:
- name: sys-tailscale
- disable:
- service.tinyproxy

4
tailscale/create.top Normal file
View File

@ -0,0 +1,4 @@
base:
dom0:
- match: nodegroup
- tailscale.create

88
tailscale/install.sls Normal file
View File

@ -0,0 +1,88 @@
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :
#
#
#
{% if salt['pillar.get']('update_proxy:caching') %}
{% set proxy = 'cacher' %}
{% endif %}
{% if grains['nodename'] != 'dom0' %}
{% if grains['os_family']|lower == 'debian' %}
{% if grains['nodename']|lower != 'host' %}
{% if proxy == 'cacher' %}
{% for repo in salt['file.find']('/etc/apt/sources.list.d/', name='*list') %}
{{ repo }}_baseurl:
file.replace:
- name: {{ repo }}
- pattern: 'https://'
- repl: 'http://HTTPS///'
- flags: [ 'IGNORECASE', 'MULTILINE' ]
- backup: False
{% endfor %}
/etc/apt/sources.list:
file.replace:
- name: /etc/apt/sources.list
- pattern: 'https:'
- repl: 'http://HTTPS/'
- flags: [ 'IGNORECASE', 'MULTILINE' ]
- backup: False
{% endif %}
requirements_installed:
pkg.installed:
- refresh: True
- pkgs:
- qubes-core-agent-networking
- qubes-core-agent-passwordless-root
- iproute2
- libnotify-bin
- lsb-release
- xz-utils
/etc/apt/sources.list.d/tailscale.list:
file.managed:
- source:
- salt://tailscale/tailscale.list
- user: root
- group: root
- makedirs: True
/usr/share/keyrings/tailscale-archive-keyring.gpg:
file.managed:
- source:
- salt://tailscale/bookworm.noarmor.gpg
- user: root
- group: root
- makedirs: True
{% if proxy == 'cacher' %}
use_cacher_tailscale:
file.replace:
- name: /etc/apt/sources.list.d/tailscale.list
- pattern: 'https:'
- repl: 'http://HTTPS/'
- flags: [ 'IGNORECASE', 'MULTILINE' ]
- backup: False
{% endif %}
tailscale_installed:
pkg.installed:
- refresh: True
- pkgs:
- tailscale
disable_tailscaled:
service.disabled:
- name: tailscaled
mask_tailscaled:
service.masked:
- name: tailscaled
{% endif %}
{% endif %}
{% endif %}

4
tailscale/install.top Normal file
View File

@ -0,0 +1,4 @@
base:
dom0:
- match: nodegroup
- tailscale.install