From 6bcfcc8d96c52356dd5f1218921523bc24dd753a Mon Sep 17 00:00:00 2001 From: Ari Kalfus Date: Sun, 4 Dec 2022 12:13:11 -0500 Subject: [PATCH] feat: add opensuse CI containers. configure uninstall tasks for opensuse (#268) * feat: add opensuse CI containers. configure uninstall tasks for opensuse * uninstall, not install --- .github/workflows/pull_request_target.yml | 2 ++ README.md | 1 + tasks/opensuse/install.yml | 4 ++-- tasks/opensuse/uninstall.yml | 6 +++--- tasks/uninstall.yml | 24 +++++++++++++---------- 5 files changed, 22 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pull_request_target.yml b/.github/workflows/pull_request_target.yml index d71145a9..600a0598 100644 --- a/.github/workflows/pull_request_target.yml +++ b/.github/workflows/pull_request_target.yml @@ -36,6 +36,8 @@ jobs: - geerlingguy/docker-debian9-ansible:latest - geerlingguy/docker-fedora31-ansible:latest - ghcr.io/artis3n/docker-arch-ansible:latest + - ghcr.io/artis3n/docker-opensuse-tumbleweed-ansible:latest + - ghcr.io/artis3n/docker-opensuse-leap-ansible:latest fail-fast: false steps: diff --git a/README.md b/README.md index 233e5054..44672246 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Supported operating systems: - Oracle Linux - Fedora - Arch Linux +- OpenSUSE - Raspbian (untested but should work through Debian support) 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. diff --git a/tasks/opensuse/install.yml b/tasks/opensuse/install.yml index 6185d9c7..a7dfb7f5 100644 --- a/tasks/opensuse/install.yml +++ b/tasks/opensuse/install.yml @@ -1,12 +1,12 @@ --- -- name: OpenSUE | Install Repo - Leap +- name: OpenSUE | Install Repo - TUmbleweed become: true community.general.zypper_repository: repo: "{{ opensuse_tumbleweed_repository }}" state: present when: ansible_distribution == "openSUSE Tumbleweed" -- name: OpenSUSE | Install Repo - Tumbleweed +- name: OpenSUSE | Install Repo - Leap become: true community.general.zypper_repository: repo: "{{ opensuse_leap_repository }}" diff --git a/tasks/opensuse/uninstall.yml b/tasks/opensuse/uninstall.yml index 75b7f7a2..e6a6ddaf 100644 --- a/tasks/opensuse/uninstall.yml +++ b/tasks/opensuse/uninstall.yml @@ -1,12 +1,12 @@ --- -- name: OpenSUE | Remove Repo - Leap +- name: OpenSUE | Remove Repo - Tumbleweed become: true community.general.zypper_repository: repo: "{{ opensuse_tumbleweed_repository }}" state: absent when: ansible_distribution == "openSUSE Tumbleweed" -- name: OpenSUSE | Remove Repo - Tumbleweed +- name: OpenSUSE | Remove Repo - Leap become: true community.general.zypper_repository: repo: "{{ opensuse_leap_repository }}" @@ -18,4 +18,4 @@ community.general.zypper: name: tailscale update_cache: true - state: '{{ state }}' + state: absent diff --git a/tasks/uninstall.yml b/tasks/uninstall.yml index e2b21474..ea9fa517 100644 --- a/tasks/uninstall.yml +++ b/tasks/uninstall.yml @@ -22,6 +22,17 @@ path: "{{ ansible_env.HOME }}/.artis3n-tailscale" state: absent +- name: Uninstall | Gather Service Facts + ansible.builtin.service_facts: + +- name: Uninstall | Disable Tailscale Service + become: true + ansible.builtin.service: + name: "{{ tailscale_service }}" + state: stopped + enabled: false + when: tailscale_service in ansible_facts.services + - name: Uninstall | CentOS and related families when: ansible_distribution in centos_family_distros ansible.builtin.include_tasks: centos/uninstall.yml @@ -38,13 +49,6 @@ when: ansible_distribution == 'Archlinux' ansible.builtin.include_tasks: arch/uninstall.yml -- name: Uninstall | Gather Service Facts - ansible.builtin.service_facts: - -- name: Uninstall | Disable Tailscale Service - become: true - ansible.builtin.service: - name: "{{ tailscale_service }}" - state: stopped - enabled: false - when: tailscale_service in ansible_facts.services +- name: Uninstall | OpenSUSE + when: ansible_distribution in opensuse_family_distros + ansible.builtin.include_tasks: opensuse/uninstall.yml