completed tailscale

This commit is contained in:
Matthew Stobbs
2025-02-07 14:16:52 -07:00
parent 6fd2fee66a
commit f52ebe093e
4 changed files with 74 additions and 9 deletions

View File

@@ -16,7 +16,7 @@
ansible.builtin.command:
creates: /etc/yum.repos.d/hashicorp.repo
cmd: "dnf config-manager addrepo --from-repofile={{ pkgconfig_hashicorp.Linux.Fedora.repo }}"
- name: enable hashicorp repo for fedora <41
become: true
when:
@@ -25,7 +25,7 @@
ansible.builtin.command:
creates: /etc/yum.repos.d/hashicorp.repo
cmd: "dnf config-manager --add-repo {{ pkgconfig_hashicorp.Linux.Fedora.repo }}"
- name: enable hashicorp repo for RHEL like distribution
become: true
when:
@@ -41,12 +41,12 @@
state: directory
prefix: hashicorp.
register: d_hashicorp_tmp
- name: get hashicorp archive gpg key
ansible.builtin.get_url:
dest: "{{ d_hashicorp_tmp.path }}/gpg"
url: https://apt.releases.hashicorp.com/gpg
- name: install hashicorp archive gpg key
become: true
ansible.builtin.command:
@@ -56,7 +56,7 @@
- -o
- /usr/share/keyrings/hashicorp-archive-keyring.gpg
- "{{ d_hashicorp_tmp.path }}/gpg"
- name: enable hasicorp repo for debian
ansible.builtin.apt_repository:
repo: "{{ pkgconfig_hashicorp.Linux.Debian.repo }}"

View File

@@ -1,8 +1,57 @@
# TODO: implement
---
- name: append to syspkgs
debug:
msg: "NOT IMPLEMENTED YET"
- ansible.builtin.include_vars:
file: tailscale.yml
name: _tailscale
- ansible.builtin.set_fact:
pkgconfig_tailscale: "{{ _tailscale | ansible.builtin.combine(pkgconfig.tailscale) }}"
- name: enable for linux
block:
- name: enable for RedHat distros
block:
- name: fedora >=41
ansible.builtin.command:
creates: /etc/yum.repos.d/tailscale.repo
cmd: "dnf config-manager addrepo --from-repofile={{ pkgconfig_tailscale.url_base }}/fedora/tailscale.repo"
become: true
when:
- ansible_distribution == 'Fedora'
- ansible_distribution_major_version|int >= 41
- name: fedora <41
ansible.builtin.command:
creates: /etc/yum.repos.d/tailscale.repo
cmd: "dnf config-manager --add-repo {{ pkgconfig_tailscale.url_base }}/fedora/tailscale.repo"
become: true
when:
- ansible_distribution == 'Fedora'
- ansible_distribution_major_version|int < 41
- name: rhel based distros
ansible.builtin.command:
creates: /etc/yum.repos.d/tailscale.repo
cmd: "dnf config-manager --add-repo {{ pkgconfig_tailscale.url_base }}/rhel/{{ ansible_os_major_version }}/tailscale.repo"
become: true
when:
- ansible_distribution != 'Fedora'
when: ansible_os_family == 'RedHat'
- name: enable for Debian distros
block:
- name: install tailscale keyring
block:
- ansible.builtin.get_url:
url: "{{ pkgconfig_tailscale.url_base }}/debian/{{ pkgconfig_tailscale.release[ansible_os_release].gpg }}"
dest: /usr/share/keyrings/tailscale-archive-keyring.gpg
become: true
- ansible.builtin.get_url:
url: "{{ pkgconfig_tailscale.url_base }}/debian/{{ pkgconfig_tailscale.release[ansible_os_release].list }}"
dest: /etc/apt/sources.list.d/tailscale.list
become: true
when: ansible_os_family == 'Debian'
- name: append to syspkgs
ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + [ 'tailscale' ] }}"
when: ansible_os_family != 'Darwin'
- name: append to caskpkgs

View File

@@ -51,6 +51,7 @@ pkgconfig:
packer: {}
python3: {}
rust: {}
tailscale: {}
terraform: {}
terraformls: {}
terrarepo: {}

15
vars/tailscale.yml Normal file
View File

@@ -0,0 +1,15 @@
---
url_base: https://pkgs.tailscale.com/stable
release:
bookworm:
gpg: bookworm.noarmor.gpg
list: bookworm.tailscale-keyring.list
bullseye:
gpg: bullseye.noarmor.gpg
list: bullseye.tailscale-keyring.list
buster:
gpg: buster.gpg
list: buster.list
stretch:
gpg: stretch.gpg
list: stretch.list