ansible-container | DEPRECATED -- Ansible Container was a tool to build Docker | Continuous Deployment library
kandi X-RAY | ansible-container Summary
kandi X-RAY | ansible-container Summary
Ansible Container is a tool for building Docker images and orchestrating containers using Ansible playbooks.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Build and build an integration
- Generate a playbook for a service
- Generate a fingerprint for a role
- Resolve a role to a path
- Generate an integration playbook
- Get top level secrets
- Generate a play map
- Returns the latest image for a service
- Restart a running engine
- Wait for ansible_1
- Run a command on the container
- Deploy a host to a host
- Destroy a container
- Start a host command
- Push images to the registry
- Deploy an engine
- Commit a role as a layer
- Build a host command
- Set the environment
- Build a container image
- Bootstrap the tool
- Convert metadata to image config format
- Adds a sub - command parser to subparser
- Run a host command
- Process services
- Command line arguments
ansible-container Key Features
ansible-container Examples and Code Snippets
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/py
# Create a new project
oc new-project demo
# Set the working directory to the project root
$ cd demo
# Push the images to the local OpenShift registry
$ ansible-container push --push-to https://local.openshift/demo --username developer --password
# Create a new directory for your project
$ mkdir demo
# Set the working directory
$ cd demo
# Initialize the project
$ ansible-container init ansible.django-template
# Create the container images
$ ansible-container build
# Start the containers
- name: Create container
docker_container:
name: docker-test
image: ubuntu:18.04
command: sleep 1d
- name: Install python on docker
delegate_to: docker-test
raw: apt -y update && apt install -y python-minimal
$ sudo pip install virtualenv
$ virtualenv venv
$ source venv/bin/activate
$ pip install ansible
$ pip install ansible-container[docker]
$ pip install docker==2.7.0
$ git clone https://github.com/mkowsiak/ansible-w
- name: Install nginx
hosts: web
roles:
- j00bar.nginx-container
Version: 2
services:
nginx:
image: centos:7
ports:
- "8000:80"
user: 'nginx'
command: ['/usr/bin/dumb-init', 'nginx', '-c
Community Discussions
Trending Discussions on ansible-container
QUESTION
I am trying to build and run two Docker containers hosting PostgreSQL and Citus extension using ansible-container
. I am aware that Citus provides containers, but I want to build my own.
My container.yaml
looks as follows:
ANSWER
Answered 2017-Feb-23 at 13:51The problem is related to the default shutdown method of the pg_ctl stop
mode (pg_ctl
gets called by pg_ctlcluster
). Stopping the cluster via pg_ctlcluster
with the pg_ctl
option -m smart
during the build process solves this problem:
QUESTION
I'm trying to use my existing docker playbooks to provision a docker container using ubuntu 18.04 for local development.
I'm having trouble running playbooks on the container as it does not come with python installed, so from my understanding ansible cannot run.
Is there a way i can install python on the container so that my playbooks can run?
NB I know that ansible-container exists but i would like to use my existing playbooks which use become_user and that doesn't work as stated on the build instructions
...ANSWER
Answered 2019-Apr-23 at 11:56I didn't realise you could just do this.
QUESTION
We just started getting container.yml "is not JSON serializable" from ansible-container 0.9.2 - which was the version we have been running for months and no errors have a occurred. Any ideas why this could just started?
Our stack trace is
...ANSWER
Answered 2018-Aug-09 at 20:00Reposting from comments:
So while looking up what ruamel.yaml (0.15.52) was, it looks like your version was released today. Did you upgrade your env recently?
QUESTION
I am working on ansible container example as mentioned in http://docs.ansible.com/ansible-container/getting_started.html and getting error while doing ansible-container build.
Container Type is dockers.
I am new to Ansible containers module and any help is much appreciated. Thank you!!
...ANSWER
Answered 2018-Apr-26 at 12:46I suggest to use virtualenv
.
Take a look here for a full sample. First, install virtualenv and ansible inside it
QUESTION
I am trying to use Ansible Container for a basic example which is supposed to install Node within the image. When I use the ansible-container build
command, after successfully building the conductor image, it fails the first task with a sudo
related error. The task in question requires root
privileges to be executed.
I am running Debian GNU/Linux 9.2 (stretch) with Docker 17.09.0-ce installed through the Docker APT repository. I tried with Ansible both from Debian Stretch (2.2.1.0-2) and from Pypi (2.4.1.0). I tried Ansible Container from Pypi (0.9.3rc0) and from the latest Git source. I always get the exact same error output.
The Ansible module complains about the following:
...ANSWER
Answered 2018-Mar-15 at 09:39I found the cause for this:
The base image debian:stretch
does not include sudo
. Therefore a solution was to set the become_method
to su
instead. Normally, this can either be done per task, host or playbook. Because it is not obvious where the equivalent of a playbook lies in Ansible Container and how the concept of hosts applies, I only really had the option to use the task level.
I decided to add a role which installs sudo
in the image and only set the become_method
to su
for the solitary task within this role. Atfer the role is applied, no further change is needed and the original tasks work.
A follow-up problem then was, that also GnuPG was not installed either to accomplish the apt_key
module task properly. The following solution solves both problems:
QUESTION
I'm trying to use ansible-container to create and deploy my docker application but I can't get it to work.
I have a remote server which I can configure via ansible. On my local machine I'm using ansible-container to build a docker image which is working fine. After running ansible-container build
I have the docker image on my local machine.
However, I don't get the next step to work. My goal is to push the docker image from my local machine to the remote server and then create and start a docker container based on this image on the remote server.
I'm not using a docker registry. Therefore I'm using the --local-images
option for ansible-container deploy
command which prevents it from pushing the image to a registry (at least this is what I understand from the docs). This command successfully creates an ansible playbook but when I execute this playbook it still tries to pull the image from the docker.io registry and of course can't find it there.
I think the missing step is to push the local docker image to the remote server but I can't find any hints in the ansible-container docs for this use-case. I have also looked at ansible docker_image module but as far as I understand this is also centered around using a registry.
How can I deploy a docker image to a remote server with ansible?
...ANSWER
Answered 2017-Dec-22 at 16:38If you don't have a docker registry, what you need to do is save the image into a tarball, then upload it to the machine, then import the tarball back into a docker image.
On your local machine save the image into a tarball:
QUESTION
I'm trying to share a volume between multiple Docker containers using Ansible Container and am getting the following error:
docker.errors.NotFound: 404 Client Error: Not Found ("No such container: web_data")
My container.yml looks like:
...ANSWER
Answered 2017-Oct-11 at 05:39Ok, so it turns out that volumes_from
is ignored by ansible-container build.
https://docs.ansible.com/ansible-container/container_yml/reference.html#volumes-from
QUESTION
I'm trying to create simple Docker image with ansible-container build command.
And I can't figure out a solution to the error I came across while doing so.
Here are most important files:
main.yml
...ANSWER
Answered 2017-Feb-06 at 15:17Most of Ansible modules require Python on target host (container in your case).
ubuntu:14.04
Docker image doesn't have one preinstalled.
Use this in your main.yml:
QUESTION
I am struggling with ansible-container. I have an issue similar to that found in here where it was suggested that docker is not configured correctly. Basically I have a bare bones example and no container is built. I have docker install on Ubuntu 16.04 as per instructions and the hello world and Ubuntu bash examples both work.
Could someone point me to some documentation/references that indicate the correct docker setup and/or the best way of debugging this. It occurred to me that my dns may not be configured correctly.
I simply tuse the following commands and get the resulting error:
...ANSWER
Answered 2017-Jan-14 at 15:11Your ansible/container.yml
has a line with a command like
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ansible-container
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page