From 3281a7ca714e6a2c03777cc922e8601e520c0708 Mon Sep 17 00:00:00 2001 From: Salt Date: Sat, 31 Jul 2021 20:30:16 -0500 Subject: [PATCH] Add integration with my ZT management network --- .gitlab-ci.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9588899..36d33a8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ stages: before_script: # Get the packages we need - apt-get update - - apt-get install openssh-client python3-docker python3-pip python-is-python3 -y + - apt-get install gnupg openssh-client python3-docker python3-pip python-is-python3 wget -y - pip install ansible ansible-lint # Dump our key - eval $(ssh-agent -s) @@ -19,8 +19,21 @@ before_script: - echo "$ANSIBLE_VAULT_PASSWORD" > /vaultpw # Fix perms on the playbook root - chmod -R 0750 . + # Join the Zerotier management network + - [ -n "$ZEROTIER_NETWORK_ID" ] && \ + wget -qO - https://raw.githubusercontent.com/zerotier/ZeroTierOne/master/doc/contact%40zerotier.com.gpg | apt-key add - && \ + echo "deb http://download.zerotier.com/debian/buster buster main" >> /etc/apt/sources.list && \ + apt update && \ + apt install zerotier-one && \ + service zerotier-one start && \ + zerotier-cli join "$ZEROTIER_NETWORK_ID" && \ + zerotier-cli info && \ + zerotier-cli listnetworks # Get ready for execution - ansible-galaxy install -r roles/requirements.yml -p roles +after_script: + - [ -n "$ZEROTIER_NETWORK_ID" ] && \ + zerotier-cli leave "$ZEROTIER_NETWORK_ID" Lint: allow_failure: yes