GithubHelp home page GithubHelp logo

geerlingguy / docker-ubuntu1404-ansible Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 20.0 10 KB

Ubuntu 14.04 LTS (Trusty) Docker container for Ansible playbook and role testing.

Home Page: https://hub.docker.com/r/geerlingguy/docker-ubuntu1404-ansible/

License: MIT License

Dockerfile 55.59% Dockerfile 44.41%
docker ansible ubuntu ubuntu1404 container image hub trusty

docker-ubuntu1404-ansible's Introduction

Ubuntu 14.04 LTS (Trusty) Ansible Test Image

Docker Automated build

Ubuntu 14.04 LTS (Trusty) Docker container for Ansible playbook and role testing.

Tags

  • latest: Latest stable version of Ansible.
  • testing: Same as latest, but with additional testing dependencies, including:
    • yamllint
    • ansible-lint
    • flake8
    • testinfra
    • molecule

The latest tag is a lightweight image for basic validation of Ansible playbooks. The testing tag also includes a comprehensive suite of Ansible and infrastructure testing tools in case you want them pre-installed.

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. cd into this directory.
  3. Run docker build -t ubuntu1404-ansible .

Note: Switch between master and testing depending on whether you want the extra testing tools present in the resulting image.

How to Use

  1. Install Docker.
  2. Pull this image from Docker Hub: docker pull geerlingguy/docker-ubuntu1404-ansible:latest (or use the image you built earlier, e.g. ubuntu1404-ansible).
  3. Run a container from the image: docker run --detach --privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro geerlingguy/docker-ubuntu1404-ansible:latest (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).
  4. Use Ansible inside the container: a. docker exec --tty [container_id] env TERM=xterm ansible --version b. docker exec --tty [container_id] env TERM=xterm ansible-playbook /path/to/ansible/playbook.yml --syntax-check

Notes

I use Docker to test my Ansible roles and playbooks on multiple OSes using CI tools like Jenkins and Travis. This container allows me to test roles and playbooks using Ansible running locally inside the container.

Important Note: I use this image for testing in an isolated environment—not for production—and the settings and configuration used may not be suitable for a secure and performant production environment. Use on production servers/in the wild at your own risk!

Author

Created in 2016 by Jeff Geerling, author of Ansible for DevOps.

docker-ubuntu1404-ansible's People

Contributors

bndabbs avatar geerlingguy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

docker-ubuntu1404-ansible's Issues

Broken repository

&& add-apt-repository ppa:jonathonf/python-2.7 \

Hi,

I have notice there is a problem with this repository trying to update repository list:

root@3f7e39757e8b:/# apt-get clean
root@3f7e39757e8b:/# apt-get update
Ign http://archive.ubuntu.com trusty InRelease
Ign http://ppa.launchpad.net trusty InRelease                              
Get:1 http://archive.ubuntu.com trusty-updates InRelease [65.9 kB]         
Ign http://ppa.launchpad.net trusty Release.gpg                                
Get:2 http://security.ubuntu.com trusty-security InRelease [65.9 kB]           
Ign http://ppa.launchpad.net trusty Release                                    
Err http://ppa.launchpad.net trusty/main amd64 Packages                        
  
Err http://ppa.launchpad.net trusty/main amd64 Packages                        
  
Get:3 http://archive.ubuntu.com trusty-backports InRelease [65.9 kB]       
Err http://ppa.launchpad.net trusty/main amd64 Packages                        
  
Get:4 http://archive.ubuntu.com trusty Release.gpg [933 B]                     
Get:5 http://archive.ubuntu.com trusty-updates/main amd64 Packages [1460 kB]   
Err http://ppa.launchpad.net trusty/main amd64 Packages                       
  
Err http://ppa.launchpad.net trusty/main amd64 Packages                       
  403  Forbidden
Get:6 http://security.ubuntu.com trusty-security/main amd64 Packages [1032 kB]
Get:7 http://archive.ubuntu.com trusty-updates/restricted amd64 Packages [21.4 kB]
Get:8 http://archive.ubuntu.com trusty-updates/universe amd64 Packages [671 kB]
Get:9 http://archive.ubuntu.com trusty-updates/multiverse amd64 Packages [16.1 kB]
Get:10 http://archive.ubuntu.com trusty-backports/main amd64 Packages [14.7 kB]
Get:11 http://archive.ubuntu.com trusty-backports/restricted amd64 Packages [40 B]
Get:12 http://archive.ubuntu.com trusty-backports/universe amd64 Packages [52.5 kB]
Get:13 http://archive.ubuntu.com trusty-backports/multiverse amd64 Packages [1392 B]
Get:14 http://archive.ubuntu.com trusty Release [58.5 kB]                  
Get:15 http://archive.ubuntu.com trusty/main amd64 Packages [1743 kB]
Get:16 http://security.ubuntu.com trusty-security/restricted amd64 Packages [18.1 kB]
Get:17 http://security.ubuntu.com trusty-security/universe amd64 Packages [378 kB]
Get:18 http://security.ubuntu.com trusty-security/multiverse amd64 Packages [4730 B]
Get:19 http://archive.ubuntu.com trusty/restricted amd64 Packages [16.0 kB]
Get:20 http://archive.ubuntu.com trusty/universe amd64 Packages [7589 kB]
Get:21 http://archive.ubuntu.com trusty/multiverse amd64 Packages [169 kB]
Fetched 13.4 MB in 6s (2097 kB/s)                                              
W: Failed to fetch http://ppa.launchpad.net/jonathonf/python-2.7/ubuntu/dists/trusty/main/binary-amd64/Packages  403  Forbidden

E: Some index files failed to download. They have been ignored, or old ones used instead.
root@3f7e39757e8b:/# python --version
Python 2.7.14
root@3f7e39757e8b:/#

I had to remove it to test ansible-playbooks in there when installing packages with the update_cache option.

Ansible role installation from Galaxy failing due to SNI cert compatibility

See error like:

Requirements file detected; installing dependencies.
 [WARNING]: - geerlingguy.repo-remi was NOT installed successfully: Failed to
get data from the API server (https://galaxy.ansible.com/api/): Failed to
validate the SSL certificate for galaxy.ansible.com:443. Make sure your managed
systems have a valid CA certificate installed. If the website serving the url
uses SNI you need python >= 2.7.9 on your managed machine  (the python
executable used (/usr/bin/python) is version: 2.7.6 (default, Nov 23 2017,
15:49:48) [GCC 4.8.4]) or you can install the `urllib3`, `pyOpenSSL`, `ndg-
httpsclient`, and `pyasn1` python modules to perform SNI verification in python
>= 2.6. You can use validate_certs=False if you do not need to confirm the
servers identity but this is unsafe and not recommended. Paths checked for this
platform: /etc/ssl/certs, /etc/pki/ca-trust/extracted/pem, /etc/pki/tls/certs,
/usr/share/ca-certificates/cacert.org, /etc/ansible. The exception msg was:
hostname u'galaxy.ansible.com' doesn't match either of
'*.c1e4.galaxy.openshiftapps.com', 'c1e4.galaxy.openshiftapps.com'.

From: https://travis-ci.org/geerlingguy/ansible-role-php/jobs/401320807

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.