GithubHelp home page GithubHelp logo

ansible / ansible-container-examples Goto Github PK

View Code? Open in Web Editor NEW
77.0 10.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

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

ansible-container-examples's Issues

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

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.

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