Code Monkey home page Code Monkey logo

packer_coreos-ansible-python's Introduction

Core-OS with Python, Ansible, and Docker-Compose

This is the packer configuration for building Core-OS image with pre-setup Python, Ansible, and Docker-Compose.

Currently based on version 1745.5.0.

Vagrant-Cloud Link: https://app.vagrantup.com/jaskaranbir/boxes/coreos-ansible

About

This configuration targets Vagrant-VirtualBox only (at the moment). So it generates a Vagrant box. However, other targets such as VMWare can be easily added.

This is the latest stable release (as per commit-date) for the Core-OS. It uses ActivePython for Python, and installs Ansible using PIP.

By deafult, Ignition is only used to insert the Vagrant insecure key. Since ignition is already used, do not use Ignition again to orchestrate the OS. This might cause problems (suchas failure to boot). Instead, use Ansible.

Why

This is intended to orchestrate the local environment for Vagrant-VirtualBox.

Including Ansible within the Box will allow developers to directly use Vagrant's Ansible provisioning without having to actually install Ansible on their local. Hence, the complete setup can be automated.

Running the Box using Vagrant

The Vagrantfile provided at the root of repo can be used as a base Vagrantfile (its further based on Core-OS Vagrant's Vagrantfile).

When running vagrant up, you might see some SSH failure messages such as:

core-01: Warning: Connection reset. Retrying...

This is normal. Core-OS takes a little while to boot, so Vagrant will just have to keep retrying to SSH until th VM is booted and SSH is ready to go. Feel free to take a look at GUI in VirtualBox to see what's happening (also helps in debugging).

Building the image

Using Makefile

  • Run make build to build the image. This also enables debugging options by default. This will also generate a log file with the Packer output.

  • Run make build-d to build without debugging options.

  • Check out Makefile for all targets

Without using Makefile

The usual Packer command: packer build coreos.json

Testing the Box

A basic "test-suite" (is it even enough to be called a Test-Suite?) bash script can be found in "tests" directory. The simple script simply checks if all binaries: Python, Ansible, Docker-Compose are accessible by the system.

The tests are automatically run after evey Packer build, and the Packer build won't succeed unless are tests are passed.

Running the test:

Using make: make test.

Manual Testing: Just execute tests/basic_test_suite.sh.

FAQs

  • Do you intend to suport any other options such as VMWare?

No, no such plans yet. As I said earlier, it should be easy to extend this configuration to other hypervisors. I like free stuff; VirtualBox is free, and simple.

  • Why not use Vagrantfile to setup all this?

A pre-packaged box such as this ensures consistency and makes environment less error-prone. Additionally, this is usually the base setup for my Vagrant these days.

packer_coreos-ansible-python's People

Contributors

jaskaranbir avatar

Stargazers

 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.