GithubHelp home page GithubHelp logo

ansible-container-lab's Introduction

Simple Ansible lab in Docker containers.

This action creates four Ubuntu Docker containers on which you can practice simple plays with Ansible.

Be sure to only use this lab in a POC environment on a secure local network.

Prerequisites

Install Docker nad Docker composer

curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh

Install Docker Composer

sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

How to use

Clone this repo.

git clone https://github.com/kmkamyk/ansible-container-lab.git

Enter to repository and generete ssh key

cd ansible-container-lab ;ssh-keygen -f ubuntu/keycontainer

Run Docker composer from ansible-container-lab directory.

docker-compose up -d

Login to Ctl container.

ssh [email protected] -i ubuntu/keycontainer

[example] Play ad-hoc action from ~/ansible folder.

cd ansible ; ansible nodes -i inventory.yml -m ping
Have fun !


If you do something wrong, just rebuild the containers.

docker-compose up --build --force-recreate -d

Clean up

Or if you decide to stop playing, clean up after yourself

docker-compose down

Topology

Control Node:
hostname: AnsibleNodeCtl, IP: 10.18.0.10

Nodes:
hostname: AnsibleNode1, IP: 10.18.0.x
hostname: AnsibleNode2, IP: 10.18.0.x
hostname: AnsibleNode3, IP: 10.18.0.x

Modify it according to your needs, docker-compose.yml and Dockerfile are yours

ansible-container-lab's People

Contributors

kmkamyk 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.