Giter VIP home page Giter VIP logo

docker-coreos-ansible-toolbox's Introduction

Docker CoreOS Ansible toolbox

CoreOS is awesome, so is Ansible. However, running Ansible tasks on CoreOS is a pain, mostly due to lack of Python, which is not there for a good reason. CoreOS toolbox is a small script that uses containers to let you bring in your favorite tools into CoreOS. This is small-sized alternative toolbox image built specifically for running Ansible tasks on CoreOS machines, it's based on Alpine Linux and has Python, pip and Ansible preinstalled, and under 70 MB in size unpacked.

Circle CI

Attention

This repository was created with hopes of possibility to easily execute ansible commands within toolbox with full access to CoreOS resources. The general idea is great, but fails in practice when you need to do anything outside pure Python, for example, control etcd or fleet, or systemd, or something else that lives on the host. You can provide access to many things by mounting executables and dependencies as volumes, but this starts to feel hacky very quickly and sometimes doesn't work.

My advice is to setup Python on the host if dealing with similar scenarios. Otherwise, using Python withing toolbox is a neat way to do stuff, highly recommended.

Running

Toolbox setup and installation is covered in CoreOS documentation, in a nutshell, to make it the default toolbox image you must specify ianbytchek/coreos-ansible-toolbox image in ~/.toolboxrc parameters manually or via cloud-config.

TOOLBOX_DOCKER_IMAGE=ianbytchek/coreos-ansible-toolbox
TOOLBOX_USER=root

Vincent Ambo has a great article on provisioning CoreOS with Ansible. Besides configuring ~/.toolboxrc you'll also need to create /opt/bin/python and /opt/bin/pip and set ansible_python_interpreter inventory variable to /opt/bin/python.

# Use --quiet option to prevent nspawn printing useless messages every time we call `python` and `pip`.

sudo mkdir --parents '/opt/bin'

sudo tee '/opt/bin/python' > /dev/null <<-'EOL'
	#!/bin/bash
	toolbox --quiet --bind=/home:/home python "$@"
EOL

sudo chmod +x '/opt/bin/python'

sudo tee '/opt/bin/pip' > /dev/null <<-'EOL'
	#!/bin/bash
	toolbox --quiet --bind=/home:/home pip "$@"
EOL

sudo chmod +x '/opt/bin/pip'

docker-coreos-ansible-toolbox's People

Contributors

iby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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