Code Monkey home page Code Monkey logo

docker-opensuse15-ansible's Introduction

OpenSUSE 15 Ansible Test Image

OpenSUSE (Leap) 15 Docker container for Ansible playbook and role testing.
This container is used to test Ansible roles and playbooks (e.g. with molecule) running locally inside the container.
A non-priviledged user ansible is created with password-less sudo configured.

Docker Build and Publish Docker Pulls CodeFactor Grade

Tags

The following tags are available:

  • latest: Latest stable version of Ansible on Python 3.x

How to Build

This image is built on Docker Hub automatically any time the upstream OS container is rebuilt, and any time a commit is made or merged to the master branch. But if you need to build the image on your own locally, do the following:

  1. Install Docker.
  2. Clone this repository and cd into this directory.
  3. Run docker build -t opensuse15-ansible .

How to Use Standalone

  1. Install Docker.
  2. Pull this image from Docker Hub or use the image you built earlier, e.g. opensuse15-ansible:latest.
docker pull timgrt/opensuse15-ansible:latest
  1. Run a container from the image. To test my Ansible roles, I add in a volume mounted from the current working directory with --volume=`pwd`:/etc/ansible/roles/role_under_test:ro.
docker run --detach --privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro timgrt/opensuse15-ansible:latest
  1. Use Ansible inside the container.
docker exec --tty [container_id] env TERM=xterm ansible --version
docker exec --tty [container_id] env TERM=xterm ansible-playbook /path/to/ansible/playbook.yml

How to Use with Molecule

  1. Install Docker.
  2. Install Molecule.
  3. Add Image in molecule.yml.

For example:

---
driver:
  name: docker
platforms:
  - name: opensuse15
    image: timgrt/opensuse15-ansible:latest
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    privileged: true
    command: "/sbin/init"
    pre_build_image: true
provisioner:
  name: ansible
  config_options:
    defaults:
      interpreter_python: auto_silent
      callback_whitelist: profile_tasks, timer, yaml
      stdout_callback: yaml
    ssh_connection:
      pipelining: false
  inventory:
    host_vars:
      opensuse15:
        ansible_user: ansible

Author

Created 2021 by Tim Grützmacher, inspired by Jeff Geerling

docker-opensuse15-ansible's People

Contributors

timgrt avatar

Stargazers

 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.