Giter Club home page Giter Club logo

ansible_container_lab's Introduction

Ansible Container Lab

The Official Git Repository for Containerization with Ansible 2 by Aric Renzo

To the Reader

Thank you very much for taking the time to purchase and read my first book, Containerization with Ansible 2 and having the interest to go over the examples listed within the book. It is my hope that you not only learn a lot from the book, but gain a deep level of understanding through the lab exercises contained within this repository. Sincerely - Thank You.

Overview

This Github repository contains the supplemental content and code examples as seen in the book Containerization with Ansible 2 by Aric Renzo, available by Packt Publishing. The examples within this repository should be used in conjunction with the book and provide a reference for Ansible Container projects. Unfortunately, if you do not have the context of the book to go on, this repository won't be of much use to you. That being said, you should checkout my book, here

This README file is broken up into two primary sections:

  • Updates: Describes any updates that have been made in the Ansible Container project that may introduce changes that function differently than described in the book.

  • Errata: Lists any fixes or corrections to content in the published book

Updates

1) Vagrant Box now uses vagrant user instead of ubuntu: The most recent versions of Vagrant and the Ubuntu 16.04 vagrant box by default leverage the user vagrant instead of ubuntu. Most of the examples in the box show the user logged in ubuntu for many of the terminal exercises. Unfortunately, the vagrant user does not have privileges to access the Docker daemon as ubuntu does, so this may have led to permission denied errors during the exection of ansible-container or docker commands. To remedy this, I have added steps in the Vagrantfile to grant vagrant the same permissions as ubuntu. Alternatively, you could just su to the ubuntu user after spinning up the VM. Feel free to reach out if you have any concerns regarding this change.

Errata

1) Fixing the AnsibleContainerException: Expecting --config-path to be a path to a file, not a directory Error: Due to a bug with the 0.92 release of Ansible Container, you may run into the following error message while working through some Ansible Container exercises in the book. Primarily, the ones which involve ansible-container push or ansible-container deploy commands:

ubuntu@node01:/vagrant/AnsibleContainer/nginx_webserser$ ansible-container push --username rogerfdias --push-to docker --tag 1.0
Enter password for user at Docker Hub:
ERROR Unknown exception
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/container/cli.py", line 299, in call
getattr(core, u'hostcmd_{}'.format(args.subcommand))(**vars(args))
File "/usr/local/lib/python2.7/dist-packages/container/init.py", line 28, in wrapped
return fn(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/container/core.py", line 360, in hostcmd_push
**kwargs)
File "/usr/local/lib/python2.7/dist-packages/container/init.py", line 28, in wrapped
return fn(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/container/core.py", line 404, in push_images
u"Expecting --config-path to be a path to a file, not a directory"
AnsibleContainerException: Expecting --config-path to be a path to a file, not a directory

This particular error is due to a bug in the 0.92 release of Ansible Container, as outlined in the following Github Issue. Essentially, when Ansible Container authenticates to a container image repository, it creates the path: ~/.docker/config.json as a directory owned by root, and not a user owned configuration file. The current work around for this issue is to delete this directory, and perform a manual docker login, as seen below:

sudo rm -rf ~/.docker
docker login --username username

This will ensure the path: ~/.docker/config.json is created correctly. All Ansible Container push and deploy commands should work after completing these steps.

Questions or Concerns

If you have any questions or concerns regarding the examples or material presented in the book Containerization with Ansible 2, feel free to send me a message or open an issue in the Github repository. I would love to hear your feedback about the book and the examples presented.

ansible_container_lab's People

Contributors

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