From 8687c860a79aba5249850d0f1c7d508d73d8eb88 Mon Sep 17 00:00:00 2001 From: Mike Holloway Date: Tue, 21 Jul 2026 22:49:34 -0400 Subject: [PATCH] Gitea Actions Testing new file: .gitea/workflows/demo.yml new file: .gitea/workflows/linode.yml new file: README.md Galaxy metadata managing new file: meta/main.yml new file: tasks/files.yml Quickstart script testing new file: tasks/main.yml Molecule testing new file: tests/inventory new file: tests/test.yml --- .gitea/workflows/demo.yml | 24 +++++++++++++++ .gitea/workflows/linode.yml | 60 +++++++++++++++++++++++++++++++++++++ README.md | 38 +++++++++++++++++++++++ meta/main.yml | 25 ++++++++++++++++ tasks/files.yml | 4 +++ tasks/main.yml | 16 ++++++++++ tests/inventory | 2 ++ tests/test.yml | 5 ++++ 8 files changed, 174 insertions(+) create mode 100644 .gitea/workflows/demo.yml create mode 100644 .gitea/workflows/linode.yml create mode 100644 README.md create mode 100644 meta/main.yml create mode 100644 tasks/files.yml create mode 100644 tasks/main.yml create mode 100644 tests/inventory create mode 100644 tests/test.yml diff --git a/.gitea/workflows/demo.yml b/.gitea/workflows/demo.yml new file mode 100644 index 0000000..bf1dbde --- /dev/null +++ b/.gitea/workflows/demo.yml @@ -0,0 +1,24 @@ +name: Gitea Actions - molecule test work +run-name: ${{ gitea.actor }} is running molecule test work +on: + push: + branches: + - molecule-test + +jobs: + Explore-molecule-Gitea-Action: + env: + ANSIBLE_ROLES_PATH: '/workspace/seasharp/ansible-role_podman-host' +# ANSIBLE_REMOTE_TMP: '/root/.ansible/tmp/' + runs-on: ubuntu-latest + steps: + - name: Project Checkout + uses: actions/checkout@v4 + with: + path: 'podman-host' + - name: Set up Python + uses: actions/setup-python@v2 + - name: Molecule test + run: | + cd podman-host/extensions + molecule test diff --git a/.gitea/workflows/linode.yml b/.gitea/workflows/linode.yml new file mode 100644 index 0000000..ae1de63 --- /dev/null +++ b/.gitea/workflows/linode.yml @@ -0,0 +1,60 @@ +name: Gitea Actions - molecule test work +run-name: ${{ gitea.actor }} is running molecule test work +on: + push: + tags: + - 'linode-test' + +jobs: + Explore-terraform-molecule-Gitea-Action: + env: + ANSIBLE_ROLES_PATH: '/workspace/seasharp/ansible-role_podman-host' +# ANSIBLE_REMOTE_TMP: '/root/.ansible/tmp/' + EQIT_VPC: '136994' + EQIT_VPC_SUBNET: '131754' + runs-on: ubuntu-latest + steps: + - name: tofu install + run: | + install -m 0755 -d /etc/apt/keyrings + curl -fsSL https://get.opentofu.org/opentofu.gpg | sudo tee /etc/apt/keyrings/opentofu.gpg >/dev/null + curl -fsSL https://packages.opentofu.org/opentofu/tofu/gpgkey | sudo gpg --no-tty --batch --dearmor -o /etc/apt/keyrings/opentofu-repo.gpg >/dev/null + chmod a+r /etc/apt/keyrings/opentofu.gpg /etc/apt/keyrings/opentofu-repo.gpg + echo "deb [signed-by=/etc/apt/keyrings/opentofu.gpg,/etc/apt/keyrings/opentofu-repo.gpg] https://packages.opentofu.org/opentofu/tofu/any/ any main + deb-src [signed-by=/etc/apt/keyrings/opentofu.gpg,/etc/apt/keyrings/opentofu-repo.gpg] https://packages.opentofu.org/opentofu/tofu/any/ any main" | tee /etc/apt/sources.list.d/opentofu.list > /dev/null + chmod a+r /etc/apt/sources.list.d/opentofu.list + apt-get update + apt-get install -y tofu + - name: Update ssh config + run: | + umask 077 + mkdir .ssh + echo -e "Host git.libre.audio\n Port 2222" >> ~/.ssh/config + - name: tofu Checkout + uses: actions/checkout@v4 + with: + repository: 'seasharp/eqit_tofu-plan' + ref: 'refs/heads/main' + path: 'tofu' + ssh-key: |- + -----BEGIN OPENSSH PRIVATE KEY----- + b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW + QyNTUxOQAAACCrwBEqzNuM0VFHpy9bBprXebPnu6oZFBfucpT1k3Bv8gAAAJh9CogdfQqI + HQAAAAtzc2gtZWQyNTUxOQAAACCrwBEqzNuM0VFHpy9bBprXebPnu6oZFBfucpT1k3Bv8g + AAAECnSrigm9ALsWTb6RnDhDFV/nViuPK1jzoE+FAmrwYfdavAESrM24zRUUenL1sGmtd5 + s+e7qhkUF+5ylPWTcG/yAAAAEW0wMHRAbWlzZXJ2ZXIubGFuAQIDBA== + -----END OPENSSH PRIVATE KEY----- + ssh-known-hosts: | + git.libre.audio ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFLiDhNN7aPdGUt8gvvAftF5Oo3xwsy/JcT9gcX00BDW + [git.libre.audio]:2222 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFLiDhNN7aPdGUt8gvvAftF5Oo3xwsy/JcT9gcX00BDW + + - name: Project Checkout + uses: actions/checkout@v4 + with: + path: 'podman-host' + - name: Set up Python + uses: actions/setup-python@v2 + - name: Molecule test + run: | + cd podman-host/extensions + molecule test -s linode diff --git a/README.md b/README.md new file mode 100644 index 0000000..cefe9fc --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +Role Name +========= + +Install and configure self-hosted Netbird, optimized for VPS (linode). + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +License +------- + +BSD 2-clause + +Author Information +------------------ + +16200915 Canada Inc. (EquilibrateIT), Mike Holloway diff --git a/meta/main.yml b/meta/main.yml new file mode 100644 index 0000000..13e9c7e --- /dev/null +++ b/meta/main.yml @@ -0,0 +1,25 @@ +--- +dependencies: [] + +galaxy_info: + role_name: podman-host + author: "Mike Holloway" + description: "Installs and configures self-hosted netbird." + company: "Equilibrate IT Inc." + license: "license (BSD-2-Clause)" + min_ansible_version: 2.10 + platforms: + - name: Fedora + versions: + - all + - name: Ubuntu + versions: + - all + - name: Debian + versions: + - all + galaxy_tags: + - networking + - system + - podman + - container diff --git a/tasks/files.yml b/tasks/files.yml new file mode 100644 index 0000000..bd23075 --- /dev/null +++ b/tasks/files.yml @@ -0,0 +1,4 @@ +- name: Install Script from `selfhosted-quickstart` + shell: + cmd: | + curl -fsSL https://github.com/netbirdio/netbird/releases/latest/download/getting-started.sh | bash diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..d3483ef --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# tasks file for podman_netbird +- name: File work + import_tasks: files.yml + +- name: Enable podman.socket for {{ service_users[0] }} + systemd: + name: podman.socket + enabled: true + state: started + scope: user + become: yes + become_user: "{{ service_users[0] }}" + +- command: + cmd: "firewall-cmd --reload" diff --git a/tests/inventory b/tests/inventory new file mode 100644 index 0000000..878877b --- /dev/null +++ b/tests/inventory @@ -0,0 +1,2 @@ +localhost + diff --git a/tests/test.yml b/tests/test.yml new file mode 100644 index 0000000..e2f5fbb --- /dev/null +++ b/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + remote_user: root + roles: + - podman_netbird