Ansible Container Cheatsheet: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
Brian Wilson (talk | contribs)
mNo edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
I'm not using ansible-container because it's horribly broken. :-(
At least, I can't get it to run on Debian Stretch.
It works until I add a role, then it fails. I gave it some time and attention and it's just not working.
== Commands ==
== Commands ==


Line 5: Line 10:
| ansible-container init  || Create a new ansible-container project in the current directory
| ansible-container init  || Create a new ansible-container project in the current directory
|-
|-
| ansible-container build ||  
| ansible-container build || With ansible-container you have to 'build' before you can 'run'.
|-
|-
| ansible-container run ''--production'' ||  
| ansible-container run ''--production'' ||  
|-
| ansible-container restart ||
|-
|-
| ansible-container stop || Stop container(s). Similar to "docker down".
| ansible-container stop || Stop container(s). Similar to "docker down".
Line 13: Line 20:
| ansible-container destroy || Stop container(s) and remove related images. Similar to "docker-compose down".
| ansible-container destroy || Stop container(s) and remove related images. Similar to "docker-compose down".
|-
|-
| ansible-container push || Send the container images up to the Docker Hub (or other registry).
| ansible-container push --username ''username'' --tag ''tag'' || Send the container images up to the Docker Hub (or other registry).
|-
|-
| ansible-container deploy || Deploy by sending the project up to a cloud service provider, either OpenShift or Kubernetes currently.
| ansible-container deploy || Deploy by sending the project up to a cloud service provider, either OpenShift or Kubernetes currently.
Line 19: Line 26:


== Project files created by 'init' ==
== Project files created by 'init' ==
  project/
  project/
   ansible.cfg - primary ansible config
   ansible.cfg - primary ansible config
Line 25: Line 33:
   meta.yml - project metadata
   meta.yml - project metadata
   requirements.yml - roles
   requirements.yml - roles
== dumb-init ==
https://github.com/Yelp/dumb-init
apt install dumb-init

Latest revision as of 18:24, 27 February 2019

I'm not using ansible-container because it's horribly broken. :-( At least, I can't get it to run on Debian Stretch.

It works until I add a role, then it fails. I gave it some time and attention and it's just not working.

Commands

ansible-container init Create a new ansible-container project in the current directory
ansible-container build With ansible-container you have to 'build' before you can 'run'.
ansible-container run --production
ansible-container restart
ansible-container stop Stop container(s). Similar to "docker down".
ansible-container destroy Stop container(s) and remove related images. Similar to "docker-compose down".
ansible-container push --username username --tag tag Send the container images up to the Docker Hub (or other registry).
ansible-container deploy Deploy by sending the project up to a cloud service provider, either OpenShift or Kubernetes currently.

Project files created by 'init'

project/
  ansible.cfg - primary ansible config
  ansible-requirements.txt - pip dependencies
  container.yml - sort of like docker-compose.yml
  meta.yml - project metadata
  requirements.yml - roles

dumb-init

https://github.com/Yelp/dumb-init
apt install dumb-init