Git Product home page Git Product logo

docker-centos9s-ansible's Introduction

Centos 9 Stream Ansible Test Image

CentOS 9 Stream Docker container for Ansible playbook and role testing.

How-To Build Image from Dockerfile

  • Download the Dockerfile onto your machine that has docker installed.
  • Run the following command to build the image:
docker build -t docker-centos9s-ansible:latest .

How-To Run the Image

  • Once the image has been built, create a container by running the following command:
docker run --detach --privileged --cgroupns=host -ti --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro docker-centos9s-ansible:latest

How-To Run Image in Molecule

NOTE: For individuals using WSL2 (Ubuntu 20.04), you may need to run the following commands on your WSL2 instance to get systemd to work:

sudo apt-get update && sudo apt-get install -yqq daemonize dbus-user-session && \
sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target && \
exec sudo nsenter -t $(pidof systemd) -a su - $LOGNAME
  • Here's an example of a molecule.yml file to test the image with your ansible playbooks/roles:
---
dependency:
  name: galaxy
driver:
  name: docker
platforms:
  - name: instance-1-centos9s
    image: docker-centos9s-ansible:latest
    command: ${MOLECULE_DOCKER_COMMAND:-"/usr/sbin/init"}
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    privileged: true
    pre_build_image: true
provisioner:
  name: ansible
  config_options:
    defaults:
      remote_tmp: /tmp
verifier:
  name: ansible
  • With molecule.yml configured, run your molecule converge playbook by running the following command:
molecule converge

Notes

This image is for TESTING PURPOSES ONLY!!

docker-centos9s-ansible's People

Contributors

zackshomelab avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.