Revive the role

Update the role to Leap 15.3 and 15.4 and switch the molecule test from
using foreign images to building the test images using custom
Dockerfiles.
This commit is contained in:
Felix Niederwanger 2022-06-27 15:30:31 +02:00
parent 179a54125b
commit 88b1306386
Signed by: phoenix
GPG key ID: 31860289A704FB3C
8 changed files with 51 additions and 9 deletions

View file

@ -2,6 +2,8 @@
galaxy_info: galaxy_info:
author: Felix Niederwanger author: Felix Niederwanger
role_name: pureftpd
namespace: geekoops
description: Install and configure PureFTPd description: Install and configure PureFTPd
company: SUSE company: SUSE
# issue_tracker_url: http://example.com/issue/tracker # issue_tracker_url: http://example.com/issue/tracker
@ -13,7 +15,8 @@ galaxy_info:
platforms: platforms:
- name: opensuse - name: opensuse
versions: versions:
- 15.2 - 15.3
- 15.4
galaxy_tags: ['ftp'] galaxy_tags: ['ftp']

View file

@ -0,0 +1,7 @@
FROM registry.opensuse.org/opensuse/leap:15.3
# Install systemd and development tools, clear cache
RUN zypper in -y systemd systemd-sysvinit firewalld python3 python3-firewall curl && rm -rf /var/cache/*
# Start container with systemd
ENTRYPOINT ["/usr/sbin/init"]

View file

@ -0,0 +1,7 @@
FROM registry.opensuse.org/opensuse/leap:15.4
# Install systemd and development tools, clear cache
RUN zypper in -y systemd systemd-sysvinit firewalld python3 python3-firewall curl && rm -rf /var/cache/*
# Start container with systemd
ENTRYPOINT ["/usr/sbin/init"]

View file

@ -6,6 +6,11 @@
include_role: include_role:
name: "geekoops-pureftpd" name: "geekoops-pureftpd"
## Setup test enviroment ## Setup test enviroment
- name: Enable firewall
systemd:
name: firewalld
state: started
enabled: true
# Test file 1 is accessible (0754), test file 2 not (0750) # Test file 1 is accessible (0754), test file 2 not (0750)
- name: Deploy test file - name: Deploy test file
copy: copy:

View file

@ -4,14 +4,23 @@ dependency:
driver: driver:
name: docker name: docker
platforms: platforms:
- name: leap15_2 - name: leap15_3
image: grisu48/leap-ansible image: registry.opensuse.org/opensuse/leap:15.3
pre_build_image: true dockerfile: Dockerfile.leap15_3
command: ${MOLECULE_DOCKER_COMMAND:-"/usr/sbin/init"}
privileged: true
volumes: volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro - /sys/fs/cgroup:/sys/fs/cgroup:ro
capabilities: tmpfs:
- SYS_ADMIN - /run
- /tmp
- name: leap15_4
image: registry.opensuse.org/opensuse/leap:15.4
dockerfile: Dockerfile.leap15_4
command: ${MOLECULE_DOCKER_COMMAND:-"/usr/sbin/init"}
privileged: true privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
tmpfs: tmpfs:
- /run - /run
- /tmp - /tmp
@ -19,8 +28,12 @@ provisioner:
name: ansible name: ansible
inventory: inventory:
host_vars: host_vars:
leap15_2: leap15_3:
ftp_dir: "/srv/ftp" ftp_dir: "/srv/ftp"
config_firewall: true
leap15_4:
ftp_dir: "/srv/ftp"
config_firewall: true
verifier: verifier:
name: testinfra name: testinfra
lint: lint:

View file

@ -20,6 +20,7 @@
group: root group: root
mode: 0744 mode: 0744
notify: restart pureftpd notify: restart pureftpd
tags: ['ftp']
- name: Ensure PureFTPd service is started and enabled - name: Ensure PureFTPd service is started and enabled
systemd: systemd:
name: "{{pureftpd_service}}" name: "{{pureftpd_service}}"
@ -27,5 +28,5 @@
enabled: true enabled: true
tags: ['ftp', 'systemd'] tags: ['ftp', 'systemd']
- include: firewall.yml - include_tasks: firewall.yml
when: config_firewall == true when: config_firewall == true

View file

@ -1,5 +1,5 @@
--- ---
# openSUSE Leap 15.2 specific variables # openSUSE Leap 15.3 specific variables
## Software packages ## Software packages

View file

@ -0,0 +1,6 @@
---
# openSUSE Leap 15.4 specific variables
## Software packages
packages: ['pure-ftpd']