Skip to content

Commit

Permalink
molecule: added MOLECULE_IMAGE for custom images and support for SuSE
Browse files Browse the repository at this point in the history
  • Loading branch information
Rendanic committed May 1, 2024
1 parent f7cbaf7 commit 614dfd8
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/molecule_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
minor_changes:
- "molecule: added MOLECULE_IMAGE for custom images and support for SuSE (oravirt#458)"
16 changes: 15 additions & 1 deletion extensions/molecule/dbfs/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,25 @@
gather_facts: true
any_errors_fatal: true
tasks:

# install missing cron on rhel9 container
- name: Install cron on RHEL/OL9
ansible.builtin.package:
name: cronie
when: ansible_distribution_major_version | int == 9
when:
- ansible_os_family == 'RedHat'
- ansible_distribution_major_version | int == 9

# install missing packages for openSUSE
- name: Install packages on openSUSE
ansible.builtin.package:
name:
- cronie
- git
- lsof
- ssh-tools
when:
- ansible_os_family == 'Suse'

- name: Converge os
ansible.builtin.import_playbook: opitzconsulting.ansible_oracle.os
Expand Down
2 changes: 1 addition & 1 deletion extensions/molecule/dbfs/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ driver:
name: docker
platforms:
- name: ol
image: "quay.io/rendanic/docker-${MOLECULE_DISTRO:-ol8}-ansible:latest"
image: "${MOLECULE_IMAGE:-quay.io/rendanic/docker-ol8-ansible:latest}"
pre_build_image: true
# The following 4 lines are needed only for making systemd work
command: ${MOLECULE_DOCKER_COMMAND:-""}
Expand Down
9 changes: 9 additions & 0 deletions extensions/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ platforms:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
- name: opensuse
image: "geerlingguy/docker-opensuseleap15-ansible:latest"
pre_build_image: true
# The following 4 lines are needed only for making systemd work
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
# - name: SLES-15-3
# image: "registry.suse.com/bci/bci-base-ansible:15.3"
# pre_build_image: true
Expand Down

0 comments on commit 614dfd8

Please sign in to comment.