Skip to content

Rocky Linux 8 container capable to use systemd, for Ansible role and playbook testing.

License

Notifications You must be signed in to change notification settings

chzerv/rockylinux8-systemd-ansible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Rocky Linux 8 Container Image for Ansible Testing

This Dockerfile builds a Rocky Linux 8 based container, capable of using systemd, mainly for Ansible role testing.

How to build locally

  1. Install Docker.

  2. Clone the repository:

    git clone https://github.com/chzerv/rockylinux8-systemd-ansible.git
  3. cd into the directory and run docker build -t rockylinux8-systemd-ansible .

docker can be substituted for any other container engine, e.g., Podman.

How to use

  1. Install Docker.

  2. Pull this image from Docker hub:

    docker pull chzerv/rockylinux8-systemd-ansible:latest

If you built the image locally, you can use that instead.

Now, you can either run commands directly inside the container:

docker run -d --privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro rockylinux8-systemd-ansible:latest ansible --version

Or, you can use it with molecule:

# molecule/default/molecule.yml
---
dependency:
  name: galaxy
driver:
  name: docker
lint: |
  set -e
  yamllint .
  ansible-lint
platforms:
  - name: instance
    image: "chzerv/${IMAGE:-rockylinux8}-systemd-ansible:latest"
    command: ${DOCKER_COMMAND:-""}
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    privileged: true
    pre_build_image: true
provisioner:
  name: ansible
  playbooks:
    converge: "${MOLECULE_PLAYBOOK:-converge.yml}"
verifier:
  name: ansible

Notes

This image is used for testing Ansible roles and playbooks locally and/or in CI, hence, security is not a concern. It is not intended or recommended to use this image in production environments.

About

Rocky Linux 8 container capable to use systemd, for Ansible role and playbook testing.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published