-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update bootstrap-saltstack-formula for docker container states
- Loading branch information
1 parent
6c63c72
commit 65df9e9
Showing
8 changed files
with
118 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=sls | ||
|
||
{% from "template/map.jinja" import santa with context %} | ||
template-config: | ||
test.nop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=yaml | ||
template: | ||
image: username/template | ||
name: template | ||
branch: latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=sls | ||
|
||
include: | ||
- template.install | ||
- template.config | ||
- template.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=sls | ||
|
||
{% from "template/map.jinja" import template with context %} | ||
template-image: | ||
dockerng.image_present: | ||
- name: {{ template.image }}:{{ template.branch }} | ||
- force: True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=jinja | ||
|
||
{% import_yaml 'template/defaults.yaml' as default_settings %} | ||
|
||
{% set os_family_map = salt['grains.filter_by']({ | ||
'Debian': {}, | ||
'Suse': {}, | ||
'Arch': {}, | ||
'RedHat': {}, | ||
} | ||
, grain="os_family" | ||
, merge=salt['pillar.get']('template:lookup')) | ||
%} | ||
{% do default_settings.santa.update(os_family_map) %} | ||
|
||
{% set template = salt['pillar.get']( | ||
'template', | ||
default=default_settings.template, | ||
merge=True | ||
) | ||
%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
template: | ||
filename: /path/on/host.ext | ||
directory: /path/on/host | ||
port: 3000 | ||
environment: | ||
# key: value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=sls | ||
|
||
{% from "template/map.jinja" import template with context %} | ||
include: | ||
- template.install | ||
template-file: | ||
file.touch: | ||
- name: {{ template.filename }} | ||
template-dir: | ||
file.directory: | ||
- name: {{ template.directory }} | ||
template-container: | ||
dockerng.running: | ||
- name: {{ template.name }} | ||
- image: {{ template.image }}:{{ template.branch }} | ||
- binds: | ||
- {{ template.directory }}:/path/on/container:rw | ||
- port_bindings: | ||
- {{ template.port }}:3000 | ||
{%- if template.environment %} | ||
- environment: | ||
{%- for env, value in template.environment.items() %} | ||
- {{ env }}: {{ value|yaml_squote }} | ||
{%- endfor %} | ||
{%- endif %} | ||
- require: | ||
- dockerng: template-image |