-
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add state present * chore: update dependencies * chore: lock after main merge * docs: update README phrasing
- Loading branch information
Showing
16 changed files
with
220 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,3 +165,31 @@ jobs: | |
run: poetry run molecule test --scenario-name args | ||
env: | ||
TAILSCALE_CI_KEY: "${{ secrets.TAILSCALE_CI_KEY }}" | ||
|
||
molecule-state-present: | ||
environment: E2E | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
# - name: Install dependency manager | ||
# run: pipx install poetry | ||
|
||
- name: Set up Python 3.x | ||
id: setup-python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: "3.10" | ||
# Once supported in https://github.com/actions/setup-python/pull/281 | ||
# cache: 'poetry' | ||
|
||
- name: Install packages | ||
run: poetry install --no-interaction | ||
|
||
- name: Molecule - State Present | ||
run: poetry run molecule test --scenario-name state-present | ||
env: | ||
TAILSCALE_CI_KEY: "${{ secrets.TAILSCALE_CI_KEY }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
- name: Cleanup | ||
hosts: all | ||
tasks: | ||
- name: De-register Tailscale node | ||
become: true | ||
ansible.builtin.command: tailscale logout | ||
changed_when: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
tasks: | ||
- name: "Include artis3n.tailscale" | ||
ansible.builtin.include_role: | ||
name: artis3n.tailscale | ||
vars: | ||
tailscale_authkey: "{{ lookup('env', 'TAILSCALE_CI_KEY') }}" | ||
state: present | ||
verbose: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
lint: | | ||
set -e | ||
ansible-lint | ||
platforms: | ||
- name: instance | ||
image: ${MOLECULE_DISTRO:-ghcr.io/artis3n/docker-ubuntu2204-ansible:latest} | ||
# Needed for systemd | ||
command: ${MOLECULE_DOCKER_COMMAND:-/lib/systemd/systemd} | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
privileged: true | ||
pre_build_image: true | ||
provisioner: | ||
name: ansible | ||
verifier: | ||
name: ansible | ||
scenario: | ||
name: state-present | ||
test_sequence: | ||
- lint | ||
- destroy | ||
- syntax | ||
- create | ||
- converge | ||
- idempotence | ||
- verify | ||
- cleanup | ||
- destroy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
tasks: | ||
- name: Get Tailscale status | ||
become: true | ||
ansible.builtin.command: tailscale status | ||
changed_when: false | ||
register: tailscale_status | ||
|
||
- name: Assertions | ||
ansible.builtin.assert: | ||
that: | ||
- "'Logged out.' not in tailscale_status.stdout" |
Oops, something went wrong.