https://github.com/senorsmile/ansible-docker_deploy
An opinionated Ansible role to to deploy multi environment single node application stacks
https://github.com/senorsmile/ansible-docker_deploy
ansible ansible-role docker
Last synced: 5 months ago
JSON representation
An opinionated Ansible role to to deploy multi environment single node application stacks
- Host: GitHub
- URL: https://github.com/senorsmile/ansible-docker_deploy
- Owner: senorsmile
- License: bsd-2-clause
- Created: 2017-02-22T05:28:43.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-08-18T22:32:56.000Z (almost 2 years ago)
- Last Synced: 2024-08-18T23:35:34.341Z (almost 2 years ago)
- Topics: ansible, ansible-role, docker
- Size: 32.2 KB
- Stars: 4
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docker_deploy
## example configuration
```yaml
#--------------------
# EXAMPLE APP WITH ALL FEATURES
#--------------------
appname_docker_apps:
- name: app_name
externally_changed: "{{ conf_changed }}"
#externally_changed forces a restart of the app
#this is usually called from another role for "inter role comm"
app_version: 'v1' #only use app_version OR app_env, NEVER both
#bare app_version is used if environments NOT desired
app_env:
integ:
app_version: 'v1'
staging:
app_version: 'v2'
prod:
app_version: 'v3'
prod_dc2:
app_version: 'v4'
image: 'hub.example.com/app_name2' #OPTIONAL, overrides the default image name below
prod_disabled:
## set both to disabled to disable this container
## for this specific environment
app_version: 'disabled'
image: 'disabled'
pull_containers: True #OPTIONAL: set to false to NOT pull containers
# this assumes that you've manually pulled the images
docker:
image: 'hub.example.com/app_name'
state: present #OPTIONAL
#DEFAULT: started
#CHOICES: [ absent, present, reloaded, started ]
restart_policy: 'no' #OPTIONAL
#recommended to set to 'no' if state: present
#CHOICES: [ "no", "on-failure", "always", "unless-stopped" ]
command: 'run' #OPTIONAL
log_driver: 'syslog' #OPTIONAL
log_options: #OPTIONAL
tag: app_name
expose: #OPTIONAL
- 8080
ports: #OPTIONAL
- '8080:8080'
volumes: #OPTIONAL
env: #OPTIONAL environment variables to inject
PORT: '8080'
```
## example role call
```yaml
- role: docker_deploy
docker_apps: "{{ appname_docker_apps }}"
docker_apps_env: "{{ appname_node_env }}"
tags:
- docker_deploy
- appname
```
Then, in your inventory:
```yaml
prodgroup:
vars:
appname_node_env: 'prod'
```