Browse Source

Add docker state.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
Maximilian Wilhelm 2 years ago
parent
commit
4cf47cbc5f
2 changed files with 33 additions and 0 deletions
  1. 28 0
      docker/init.sls
  2. 5 0
      top.sls

+ 28 - 0
docker/init.sls

@@ -0,0 +1,28 @@
+#
+# Setup docker.io
+#
+
+docker-repo:
+  pkgrepo.managed:
+    - comments: "# Docker.io"
+    - human_name: Docker.io repository
+    - name: "deb https://download.docker.com/linux/debian {{ grains.oscodename }} stable"
+    - dist: {{ grains.oscodename }}
+    - file: /etc/apt/sources.list.d/docker.list
+    - key_url: https://download.docker.com/linux/debian/gpg
+
+docker-pkgs:
+  pkg.installed:
+    - pkgs:
+      - docker-ce
+      - docker-ce-cli
+      - containerd.io
+
+# Install docker-compose via pip *shrug*
+python-pip:
+  pkg.installed
+
+docker-compose:
+  pip.installed:
+    - require:
+      - pkg: python-pip

+ 5 - 0
top.sls

@@ -93,6 +93,11 @@ base:
     - match: pillar
     - yanic
 
+  # Docker
+  nodes:{{ grains['id'] }}:roles:docker:
+    - match: pillar
+    - docker
+
 #
 # Grains
 #