Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Commit 4b2fba9

Browse files
authored
Adding Arch support (#36)
* Setting up Arch, once the image is built * New commit to trigger the workflow * Adding arch tasks, but Molecule cannot create tun device for tailscale service * Pointing CI to the new main branch * Fix idempotence due to change in tailscale up behavior
1 parent 614c7bc commit 4b2fba9

File tree

7 files changed

+180
-128
lines changed

7 files changed

+180
-128
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ name: CI Tests
44
on:
55
pull_request:
66
branches:
7-
- master
7+
- main
88
push:
99
branches:
10-
- master
10+
- main
1111

1212
jobs:
1313
molecule:
@@ -25,6 +25,7 @@ jobs:
2525
- geerlingguy/docker-debian10-ansible:latest
2626
- geerlingguy/docker-debian9-ansible:latest
2727
- geerlingguy/docker-fedora31-ansible:latest
28+
- artis3n/docker-arch-ansible:latest
2829
fail-fast: false
2930

3031
steps:

Pipfile.lock

Lines changed: 118 additions & 123 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

handlers/main.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
11
---
2+
3+
- name: Tailscale Status
4+
listen: Confirm Tailscale is Connected
5+
command: tailscale status
6+
register: handlers_tailscale_status
7+
8+
- name: Assert Tailscale is Connected
9+
listen: Confirm Tailscale is Connected
10+
assert:
11+
that:
12+
- handlers_tailscale_status.stdout | length != 0

meta/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ galaxy_info:
1414
- eoan
1515
- bionic
1616
- xenial
17+
- focal
1718
- name: EL
1819
versions:
1920
- 7
@@ -28,6 +29,9 @@ galaxy_info:
2829
- name: Fedora
2930
versions:
3031
- 31
32+
- name: ArchLinux
33+
versions:
34+
- any
3135

3236
galaxy_tags:
3337
- tailscale

molecule/default/verify.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
tasks:
55
- name: Get Tailscale status
66
become: yes
7-
command: tailscale up
7+
command: tailscale status
88
changed_when: false
99
register: tailscale_status
1010

1111
- name: Assertions
1212
assert:
1313
that:
14-
- tailscale_status.stderr == "\ntailscaled is authenticated, nothing more to do."
14+
- tailscale_status.stdout | length != 0

tasks/arch.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
3+
- name: Ensure non-root user
4+
become: yes
5+
user:
6+
name: tailscale
7+
home: /home/tailscale
8+
system: yes
9+
10+
- name: Add tailscale user to sudoers
11+
become: yes
12+
lineinfile:
13+
path: /etc/sudoers
14+
regexp: '^tailscale'
15+
line: 'tailscale ALL=(ALL) NOPASSWD: ALL'
16+
17+
- name: Download Tailscale AUR
18+
become: yes
19+
become_user: tailscale
20+
git:
21+
repo: https://aur.archlinux.org/tailscale.git
22+
dest: /home/tailscale/tailscale
23+
version: master
24+
25+
- name: Install Tailscale
26+
become: yes
27+
become_user: tailscale
28+
command: makepkg -si --noconfirm
29+
args:
30+
chdir: /home/tailscale/tailscale
31+
creates: /usr/sbin/tailscale

tasks/main.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,22 @@
2727
when: ansible_distribution == 'Fedora'
2828
include_tasks: fedora.yml
2929

30+
- name: Arch
31+
when: ansible_distribution == 'Archlinux'
32+
include_tasks: arch.yml
33+
3034
- name: Enable Service
3135
become: yes
3236
service:
3337
name: "{{ tailscale_service }}"
3438
state: started
3539
enabled: yes
3640

41+
- name: Check if Tailscale is connected
42+
command: tailscale status
43+
changed_when: false
44+
register: tailscale_status
45+
3746
- name: Bring Tailscale Up
3847
become: yes
3948
# The command module cannot use | ; &
@@ -42,4 +51,5 @@
4251
# Since the auth key is included in this task, we do not want to log output
4352
no_log: true
4453
register: tailscale_start
45-
changed_when: tailscale_start.stderr != "\ntailscaled is authenticated, nothing more to do."
54+
when: tailscale_status.stdout | length == 0
55+
notify: Confirm Tailscale is Connected

0 commit comments

Comments
 (0)