diff --git a/states/docker/containers.sls b/states/docker/containers.sls new file mode 100644 index 0000000..b4fc0a1 --- /dev/null +++ b/states/docker/containers.sls @@ -0,0 +1,12 @@ +--- +{%- from "docker/map.jinja" import docker with context %} +{% for k,v in docker.containers.items() -%} +docker-container-{{ k }}: + docker_container.running: + - name: {{ k }} +{%- for i,j in v.items() %} + - {{ i }}: {{ j }} + +{% endfor -%} + +{% endfor -%} \ No newline at end of file diff --git a/states/docker/defaults.yaml b/states/docker/defaults.yaml index 2c05833..da2ff80 100644 --- a/states/docker/defaults.yaml +++ b/states/docker/defaults.yaml @@ -7,7 +7,10 @@ docker: - docker-ce - docker-ce-cli pip_pkgs: + - docker - docker-compose daemon: config: storage-driver: overlay2 + iptables: true + containers: {} diff --git a/states/docker/init.sls b/states/docker/init.sls index 63261f2..fc311f7 100644 --- a/states/docker/init.sls +++ b/states/docker/init.sls @@ -1,5 +1,7 @@ --- include: + - repos - .install - .config - - .service \ No newline at end of file + - .service + - .containers \ No newline at end of file