Skip to content

Commit

Permalink
feat: Install latest Tailscale version by default
Browse files Browse the repository at this point in the history
  • Loading branch information
artis3n committed Jul 10, 2021
1 parent 2c3e085 commit 20f9363
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 44 deletions.
1 change: 1 addition & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ exclude_paths:

skip_list:
- line-length
- package-latest
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,20 @@
[![GitHub followers](https://img.shields.io/github/followers/artis3n?style=social)](https://github.com/artis3n/)
[![Twitter Follow](https://img.shields.io/twitter/follow/artis3n?style=social)](https://twitter.com/Artis3n)

This role initializes a [Tailscale][] node.

Find supported operating systems on this role's [Ansible Galaxy page](https://galaxy.ansible.com/artis3n/tailscale).
This role initializes a [Tailscale][] node. If Tailscale is already installed, this role will update Tailscale to the latest version.
This role does not re-apply the `up` command if Tailscale is already logged in. This will be supported in a [future release](https://github.com/artis3n/ansible-role-tailscale/issues/115).

Supported operating systems:
- Debian
- Ubuntu
- CentOS / RedHat
- Amazon Linux
- Oracle Linux
- Fedora
- Arch Linux
- Raspbian (untested but should work)

See the [CI worfklow](https://github.com/artis3n/ansible-role-tailscale/blob/main/.github/workflows/ci.yml#L15) for the list of distribution versions actively tested in each pull request.

## Requirements

Expand Down
6 changes: 3 additions & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
# Variables that an end user should likely never modify.

debian_family_distros:
- Ubuntu
- Debian
Expand All @@ -11,9 +14,6 @@ centos_family_distros:
tailscale_package: tailscale
tailscale_service: tailscaled

release_stability: stable
upgrade_release: false

repo_description: Tailscale repository

apt_dependencies:
Expand Down
9 changes: 0 additions & 9 deletions tasks/arch.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
---

- name: Arch | Install Tailscale
become: true
pacman:
name: '{{ tailscale_package }}'
update_cache: true
state: present
when: not upgrade_release | bool

- name: Arch | Install or upgrade Tailscale
become: true
pacman:
name: '{{ tailscale_package }}'
update_cache: true
state: latest
when: upgrade_release | bool
9 changes: 0 additions & 9 deletions tasks/centos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,8 @@
creates: /etc/yum.repos.d/tailscale.repo

- name: CentOS | Install Tailscale
become: true
yum:
name: "{{ tailscale_package }}"
disable_gpg_check: true
state: present
when: not upgrade_release | bool

- name: CentOS | Install or upgrade Tailscale
become: true
yum:
name: "{{ tailscale_package }}"
disable_gpg_check: true
state: latest
when: upgrade_release | bool
9 changes: 0 additions & 9 deletions tasks/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,8 @@
state: present

- name: Debian | Install Tailscale
become: true
apt:
name: "{{ tailscale_package }}"
state: present
update_cache: true
when: not upgrade_release | bool

- name: Debian | Install or upgrade Tailscale
become: true
apt:
name: "{{ tailscale_package }}"
state: latest
update_cache: true
when: upgrade_release | bool
8 changes: 0 additions & 8 deletions tasks/fedora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,7 @@
warn: false

- name: Fedora | Install Tailscale
become: true
dnf:
name: "{{ tailscale_package }}"
state: present
when: not upgrade_release | bool

- name: Fedora | Install or upgrade Tailscale
become: true
dnf:
name: "{{ tailscale_package }}"
state: latest
when: upgrade_release | bool
4 changes: 2 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
You must include a Node Authorization auth key.
Set a `tailscale_auth_key` ansible-vault encrypted variable.
You can create this key from: https://login.tailscale.com/admin/authkeys.
when: tailscale_auth_key is not defined and not tailscale_up_skip|bool
when: tailscale_auth_key == None and not tailscale_up_skip | bool

- name: Skipping Authentication
debug:
msg: You have set 'tailscale_up_skip', so this node will not authenticate to your Tailscale network.
when: tailscale_up_skip|bool
when: tailscale_up_skip | bool

- name: Unstable Warning
# Print an error message to the console but proceed anyway
Expand Down
9 changes: 8 additions & 1 deletion vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
---
# vars file for artis3n.tailscale
# Variables that a user may want to modify.

# Required Node auth key to authenticate to Tailscale
tailscale_auth_key: null
# Optional command-line arguments for 'tailscale up'
tailscale_args: null
# Whether to output debug information during role execution
verbose: false
# Whether to skip 'tailscale up'
tailscale_up_skip: false
# Whether to always run 'tailscale up'
force: false
# Whether to use the stable or unstable upstream Tailscale build.
# Strongly recommend to leave on 'stable' unless you know what you're doing
release_stability: stable

0 comments on commit 20f9363

Please sign in to comment.