Add docker template 07/8207/3
authorThanh Ha <thanh.ha@linuxfoundation.org>
Fri, 5 Jan 2018 01:21:21 +0000 (20:21 -0500)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Fri, 5 Jan 2018 01:49:04 +0000 (20:49 -0500)
Change-Id: I493d653e5d515250580cc44a2c65f07299b800c8
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
provision/docker.yaml [new file with mode: 0644]
templates/docker.json.example [new file with mode: 0644]

diff --git a/provision/docker.yaml b/provision/docker.yaml
new file mode 100644 (file)
index 0000000..beaec67
--- /dev/null
@@ -0,0 +1,16 @@
+---
+- import_playbook: baseline.yaml
+
+- hosts: all
+  become_user: root
+  become_method: sudo
+
+  pre_tasks:
+    - include_role: name=system-update
+
+  roles:
+    - docker-install
+
+  post_tasks:
+    - name: System Reseal
+      include_tasks: system-reseal.yaml
diff --git a/templates/docker.json.example b/templates/docker.json.example
new file mode 100644 (file)
index 0000000..50ad4cf
--- /dev/null
@@ -0,0 +1,57 @@
+{
+  "variables": {
+    "base_image": null,
+    "distro": null,
+    "cloud_auth_url": null,
+    "cloud_user": null,
+    "cloud_pass": null,
+    "cloud_network": null,
+    "cloud_tenant": null,
+    "cloud_user_data": null,
+    "ssh_user": null,
+    "ssh_proxy_host": ""
+  },
+  "builders": [
+    {
+      "name": "vexxhost",
+      "image_name": "ZZCI - {{user `distro`}} - docker - {{isotime \"20060102-1504\"}}",
+      "source_image_name": "{{user `base_image`}}",
+      "type": "openstack",
+      "identity_endpoint": "{{user `cloud_auth_url`}}",
+      "username": "{{user `cloud_user`}}",
+      "password": "{{user `cloud_pass`}}",
+      "tenant_name": "{{user `cloud_tenant`}}",
+      "domain_name": "Default",
+      "region": "ca-ymq-1",
+      "availability_zone": "ca-ymq-2",
+      "networks": [
+        "{{user `cloud_network`}}"
+      ],
+      "user_data_file": "{{user `cloud_user_data`}}",
+      "ssh_username": "{{user `ssh_user`}}",
+      "ssh_proxy_host": "{{user `ssh_proxy_host`}}",
+      "flavor": "v1-standard-1",
+      "metadata": {
+        "ci_managed": "yes"
+      }
+    }
+  ],
+  "provisioners": [
+    {
+      "type": "shell",
+      "scripts": [
+        "common-packer/provision/install-python.sh"
+      ],
+      "execute_command": "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi"
+    },
+    {
+      "type": "ansible",
+      "playbook_file": "common-packer/provision/docker.yaml",
+      "ansible_env_vars": [
+        "ANSIBLE_NOCOWS=1",
+        "ANSIBLE_ROLES_PATH=../lf-ansible/roles",
+        "ANSIBLE_STDOUT_CALLBACK=debug"
+      ]
+    }
+  ]
+}