minor: Add Gitea to SCM role
This commit is contained in:
14
molecule/default/Dockerfile
Normal file
14
molecule/default/Dockerfile
Normal file
@@ -0,0 +1,14 @@
|
||||
ARG MOLECULE_DISTRO=docker.io/library/debian:stable
|
||||
FROM ${MOLECULE_DISTRO}
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
python3 \
|
||||
systemd \
|
||||
systemd-sysv \
|
||||
dbus \
|
||||
ca-certificates && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
CMD ["/usr/sbin/init"]
|
||||
6
molecule/default/converge.yml
Normal file
6
molecule/default/converge.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
#SPDX-License-Identifier: GPL-3.0-only
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
roles:
|
||||
- role: ansible_role_scm
|
||||
72
molecule/default/molecule.yml
Normal file
72
molecule/default/molecule.yml
Normal file
@@ -0,0 +1,72 @@
|
||||
#SPDX-License-Identifier: GPL-3.0-only
|
||||
---
|
||||
dependency:
|
||||
name: galaxy
|
||||
options:
|
||||
requirements-file: molecule/default/requirements.yml
|
||||
|
||||
driver:
|
||||
name: podman
|
||||
|
||||
platforms:
|
||||
- name: debian-stable
|
||||
image: docker.io/library/debian:stable
|
||||
pre_build_image: false
|
||||
dockerfile: Dockerfile
|
||||
buildargs:
|
||||
MOLECULE_DISTRO: docker.io/library/debian:stable
|
||||
privileged: true
|
||||
systemd: always
|
||||
command: /usr/sbin/init
|
||||
|
||||
- name: debian-oldstable
|
||||
image: docker.io/library/debian:oldstable
|
||||
pre_build_image: false
|
||||
dockerfile: Dockerfile
|
||||
buildargs:
|
||||
MOLECULE_DISTRO: docker.io/library/debian:oldstable
|
||||
privileged: true
|
||||
systemd: always
|
||||
command: /usr/sbin/init
|
||||
|
||||
- name: ubuntu-latest
|
||||
image: docker.io/library/ubuntu:latest
|
||||
pre_build_image: false
|
||||
dockerfile: Dockerfile
|
||||
buildargs:
|
||||
MOLECULE_DISTRO: docker.io/library/ubuntu:latest
|
||||
privileged: true
|
||||
systemd: always
|
||||
command: /usr/sbin/init
|
||||
|
||||
- name: ubuntu-jammy
|
||||
image: docker.io/library/ubuntu:jammy
|
||||
pre_build_image: false
|
||||
dockerfile: Dockerfile
|
||||
buildargs:
|
||||
MOLECULE_DISTRO: docker.io/library/ubuntu:jammy
|
||||
privileged: true
|
||||
systemd: always
|
||||
command: /usr/sbin/init
|
||||
|
||||
provisioner:
|
||||
name: ansible
|
||||
env:
|
||||
ANSIBLE_ROLES_PATH: "${MOLECULE_PROJECT_DIRECTORY}/.."
|
||||
playbooks:
|
||||
converge: converge.yml
|
||||
verify: verify.yml
|
||||
|
||||
scenario:
|
||||
test_sequence:
|
||||
- dependency
|
||||
- destroy
|
||||
- syntax
|
||||
- create
|
||||
- converge
|
||||
- idempotence
|
||||
- verify
|
||||
- destroy
|
||||
|
||||
verifier:
|
||||
name: ansible
|
||||
4
molecule/default/requirements.yml
Normal file
4
molecule/default/requirements.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
#SPDX-License-Identifier: GPL-3.0-only
|
||||
---
|
||||
collections:
|
||||
- name: containers.podman
|
||||
45
molecule/default/verify.yml
Normal file
45
molecule/default/verify.yml
Normal file
@@ -0,0 +1,45 @@
|
||||
#SPDX-License-Identifier: GPL-3.0-only
|
||||
---
|
||||
- name: Verify
|
||||
hosts: all
|
||||
tasks:
|
||||
- name: Check gitea symlink
|
||||
ansible.builtin.stat:
|
||||
path: /opt/gitea/gitea
|
||||
register: gitea_symlink
|
||||
|
||||
- name: Assert gitea symlink points at a versioned binary
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- gitea_symlink.stat.exists
|
||||
- gitea_symlink.stat.islnk
|
||||
- gitea_symlink.stat.lnk_source is match('/opt/gitea/gitea-.*-linux-.*')
|
||||
|
||||
- name: Check gitea versioned binary
|
||||
ansible.builtin.stat:
|
||||
path: '{{ gitea_symlink.stat.lnk_source }}'
|
||||
register: gitea_binary
|
||||
|
||||
- name: Assert gitea binary is executable
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- gitea_binary.stat.exists
|
||||
- gitea_binary.stat.executable
|
||||
|
||||
- name: Check app.ini exists
|
||||
ansible.builtin.stat:
|
||||
path: /etc/gitea/app.ini
|
||||
register: gitea_ini
|
||||
|
||||
- name: Assert app.ini exists
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- gitea_ini.stat.exists
|
||||
|
||||
- name: Gather service facts
|
||||
ansible.builtin.service_facts:
|
||||
|
||||
- name: Assert gitea service is present
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- "'gitea.service' in ansible_facts.services"
|
||||
Reference in New Issue
Block a user