From 58344d560eef1cac0908f8674711828ef14012ea Mon Sep 17 00:00:00 2001 From: surtur Date: Sat, 29 Jul 2023 23:41:16 +0200 Subject: [PATCH] add + enable tailscale role --- ansible/playbooks/surtur.yml | 2 ++ ansible/roles/tailscale/tasks/main.yml | 30 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 ansible/roles/tailscale/tasks/main.yml diff --git a/ansible/playbooks/surtur.yml b/ansible/playbooks/surtur.yml index 5c9a4cf..60e813d 100644 --- a/ansible/playbooks/surtur.yml +++ b/ansible/playbooks/surtur.yml @@ -10,3 +10,5 @@ # - rand - configs - flathub + - role: tailscale + become: true diff --git a/ansible/roles/tailscale/tasks/main.yml b/ansible/roles/tailscale/tasks/main.yml new file mode 100644 index 0000000..77aabba --- /dev/null +++ b/ansible/roles/tailscale/tasks/main.yml @@ -0,0 +1,30 @@ +--- +- name: Install Tailscale repo + ansible.builtin.command: + cmd: > + dnf config-manager --add-repo \ + "https://pkgs.tailscale.com/stable/fedora/tailscale.repo" + args: + creates: /etc/yum.repos.d/tailscale.repo + when: ansible_distribution == "Fedora" + +- name: Enable Tailscale repo + community.general.ini_file: + path: /etc/yum.repos.d/tailscale.repo + section: tailscale-stable + option: enabled + value: 1 + create: false + when: ansible_distribution == "Fedora" + +- name: Install Tailscale + ansible.builtin.package: + name: tailscale + state: present + +- name: Enable Tailscale systemd service + ansible.builtin.systemd: + name: tailscaled + state: started + enabled: true +...