Coder Social home page Coder Social logo

ansible / ansible-container-examples Goto Github PK

View Code? Open in Web Editor NEW
77.0 77.0 48.0 227 KB

A few starter applications to demonstrate features and provide examples.

License: GNU General Public License v3.0

Nginx 10.96% Python 33.85% JavaScript 29.42% HTML 10.88% CSS 13.54% Shell 1.35%

ansible-container-examples's Introduction

PyPI version Docs badge Chat badge Build Status Ansible Code of Conduct Ansible mailing lists Repository License Ansible CII Best Practices certification

Ansible

Ansible is a radically simple IT automation system. It handles configuration management, application deployment, cloud provisioning, ad-hoc task execution, network automation, and multi-node orchestration. Ansible makes complex changes like zero-downtime rolling updates with load balancers easy. More information on the Ansible website.

Design Principles

  • Have an extremely simple setup process with a minimal learning curve.
  • Manage machines quickly and in parallel.
  • Avoid custom-agents and additional open ports, be agentless by leveraging the existing SSH daemon.
  • Describe infrastructure in a language that is both machine and human friendly.
  • Focus on security and easy auditability/review/rewriting of content.
  • Manage new remote machines instantly, without bootstrapping any software.
  • Allow module development in any dynamic language, not just Python.
  • Be usable as non-root.
  • Be the easiest IT automation system to use, ever.

Use Ansible

You can install a released version of Ansible with pip or a package manager. See our installation guide for details on installing Ansible on a variety of platforms.

Power users and developers can run the devel branch, which has the latest features and fixes, directly. Although it is reasonably stable, you are more likely to encounter breaking changes when running the devel branch. We recommend getting involved in the Ansible community if you want to run the devel branch.

Communication

Join the Ansible forum to ask questions, get help, and interact with the community.

For more ways to get in touch, see Communicating with the Ansible community.

Contribute to Ansible

  • Check out the Contributor's Guide.
  • Read Community Information for all kinds of ways to contribute to and interact with the project, including how to submit bug reports and code to Ansible.
  • Submit a proposed code update through a pull request to the devel branch.
  • Talk to us before making larger changes to avoid duplicate efforts. This not only helps everyone know what is going on, but it also helps save time and effort if we decide some changes are needed.

Coding Guidelines

We document our Coding Guidelines in the Developer Guide. We particularly suggest you review:

Branch Info

  • The devel branch corresponds to the release actively under development.
  • The stable-2.X branches correspond to stable releases.
  • Create a branch based on devel and set up a dev environment if you want to open a PR.
  • See the Ansible release and maintenance page for information about active branches.

Roadmap

Based on team and community feedback, an initial roadmap will be published for a major or minor version (ex: 2.7, 2.8). The Ansible Roadmap page details what is planned and how to influence the roadmap.

Authors

Ansible was created by Michael DeHaan and has contributions from over 5000 users (and growing). Thanks everyone!

Ansible is sponsored by Red Hat, Inc.

License

GNU General Public License v3.0 or later

See COPYING to see the full text.

ansible-container-examples's People

Contributors

dano0b avatar mholiv avatar patrickmslatteryvt avatar trishnaguha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-container-examples's Issues

Outdated examples?

I was wondering what the status of this repository is, currently—it seems like some (all?) of the examples are outdated and don't work with recent Ansible Container versions (especially ones which have main playbooks, things like that).

It's currently a bit difficult to find a source of 'guaranteed to work' ansible-container example projects around the web, which means I have to resort to reading and re-reading docs, and sometimes diving into code and individual PRs and issues on GitHub to figure out how to get something working.

Having these central examples as working/automatically-tested examples would be awesome.

Even the examples fail

Building Docker Engine context...
Starting Docker build of Ansible Container Conductor image (please be patient)...
ERROR Unknown exception
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/container/cli.py", line 299, in call
getattr(core, u'hostcmd_{}'.format(args.subcommand))(**vars(args))
File "/usr/local/lib/python2.7/site-packages/container/init.py", line 28, in wrapped
return fn(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/container/core.py", line 181, in hostcmd_build
environment=env_vars
File "/usr/local/lib/python2.7/site-packages/container/docker/engine.py", line 105, in wrapped
return fn(self, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/container/init.py", line 28, in wrapped
return fn(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/container/docker/engine.py", line 1070, in build_conductor_image
return image.id
AttributeError: 'tuple' object has no attribute 'id'

ansible-container init throws error

Traceback (most recent call last):
File "/usr/bin/ansible-container", line 11, in
load_entry_point('ansible-container==0.3.0', 'console_scripts', 'ansible-container')()
File "/usr/lib/python2.6/site-packages/pkg_resources/init.py", line 560, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.6/site-packages/pkg_resources/init.py", line 2648, in load_entry_point
return ep.load()
File "/usr/lib/python2.6/site-packages/pkg_resources/init.py", line 2302, in load
return self.resolve()
File "/usr/lib/python2.6/site-packages/pkg_resources/init.py", line 2308, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/lib/python2.6/site-packages/container/cli.py", line 12, in
from . import engine
File "/usr/lib/python2.6/site-packages/container/engine.py", line 554
special_set = {'.', ':'}
^
SyntaxError: invalid syntax

When I run ansible-container init, it throws the above error

Python version is 2.6.6

--var-file is not working

Hi Chris,
i would like to use a var_file.yml when building an sshd container, but it fails.
i cut/pasted the following 2 lines from main.yml into var_file.yml.

  vars:
    mypassword: password

Consequently, the main.yml files does not contain anymore the vars directive.

- hosts: ssh
  gather_facts: no
  tasks:
    - name: Update all packages 
      raw: apt-get update
    - name: Install python 
      raw: apt-get install -y python python-apt
    - name: Install openssh-server
      apt: name=openssh-server state=present
    - name: Create /var/run/sshd
      file: path=/var/run/sshd state=directory owner=root group=root mode=0755
    - name: Update sshd_config
      replace: dest=/etc/ssh/sshd_config regexp='^PermitRootLogin without-password' replace='PermitRootLogin yes'
    - name: Update pam settings
      replace: dest=/etc/pam.d/sshd regexp='session\s*required\s*pam_loginuid.so' replace='session optional pam_loginuid.so'
    - name: Update /etc/profile
      lineinfile: dest=/etc/profile line='VISIBLE=now'
    - name: Get encrypted password
      shell: python -c 'import crypt; print crypt.crypt("{{ mypassword }}", "$1$SomeSalt$")'
      register: output
    - name: Set root password
      user: name=root password="{{ output.stdout }}" update_password=always 

the image is built with the following command :

$ ansible-container --var-file var_file.yml build

but it fails... because variables are not defined :

TASK [Get encrypted password] **************************************************
ansible-container_1  | fatal: [ssh]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'mypassword' is undefined\n\nThe error appears to have been in '/ansible-container/ansible/main.yml': line 18, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n      lineinfile: dest=/etc/profile line='VISIBLE=now'\n    - name: Get encrypted password\n      ^ here\n"}

what am i missing ?
i tried to put the var_file.yml in the ansible directory, without success.

Thanks for your help.

Ernest.

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.