Configure docker image
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Tue, 7 Feb 2017 18:31:11 +0000 (10:31 -0800)
committerAndrew Grimberg <agrimberg@linuxfoundation.org>
Tue, 7 Feb 2017 18:31:11 +0000 (10:31 -0800)
Create a docker image, this is based on the Open-O robot image

Change-Id: I4f16494da4605753f09257107889210488ec0512
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
packer/provision/docker.sh [moved from packer/provision/robot.sh with 91% similarity]
packer/provision/redis-server.sh [deleted file]
packer/templates/docker.json [moved from packer/templates/robot.json with 92% similarity]
packer/templates/redis.json [deleted file]

similarity index 91%
rename from packer/provision/robot.sh
rename to packer/provision/docker.sh
index bac724a..4ae4b41 100644 (file)
@@ -24,8 +24,6 @@ EOL
 
     # docker group doesn't get created by default for some reason
     groupadd docker
-
-    # Actual installation of robot is done from an integration JJB script
 }
 
 ubuntu_systems() {
@@ -36,8 +34,6 @@ ubuntu_systems() {
 
     # Install docker
     apt install -y docker.io
-
-    # Actual installation of robot is done from an integration JJB script
 }
 
 all_systems() {
diff --git a/packer/provision/redis-server.sh b/packer/provision/redis-server.sh
deleted file mode 100644 (file)
index 9a29b95..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/bash
-
-# vim: ts=4 sw=4 sts=4 et tw=72 :
-
-rh_systems() {
-    echo "---> Installing IUS repo and Redis"
-    # make sure that IUS is installed
-    yum install -y https://centos7.iuscommunity.org/ius-release.rpm
-    # now install redis 3.2.x
-    yum install -y redis32u
-    systemctl enable redis
-}
-
-ubuntu_systems() {
-    echo "---> Installing Redis"
-    # Install redis-server
-    apt install -y redis-server
-}
-
-all_systems() {
-    echo 'No common distribution configuration to perform'
-}
-
-echo "---> Detecting OS"
-ORIGIN=$(facter operatingsystem | tr '[:upper:]' '[:lower:]')
-
-case "${ORIGIN}" in
-    fedora|centos|redhat)
-        echo "---> RH type system detected"
-        rh_systems
-    ;;
-    ubuntu)
-        echo "---> Ubuntu system detected"
-        ubuntu_systems
-    ;;
-    *)
-        echo "---> Unknown operating system"
-    ;;
-esac
-
-# execute steps for all systems
-all_systems
similarity index 92%
rename from packer/templates/robot.json
rename to packer/templates/docker.json
index f31ad46..5418c4b 100644 (file)
@@ -19,7 +19,7 @@
       "password": "{{user `stack_pass`}}",
       "region": "ca-ymq-1",
       "ssh_username": "{{user `cloud_user`}}",
-      "image_name": "{{user `distro`}} - robot - {{isotime \"20060102-1504\"}}",
+      "image_name": "{{user `distro`}} - docker - {{isotime \"20060102-1504\"}}",
       "source_image_name": "{{user `base_image`}}",
       "flavor": "v1-standard-1",
       "availability_zone": "ca-ymq-2",
@@ -44,7 +44,7 @@
       "scripts": [
         "provision/baseline.sh",
         "provision/basebuild.sh",
-        "provision/robot.sh",
+        "provision/docker.sh",
         "provision/system_reseal.sh"
       ],
       "execute_command": "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi"
diff --git a/packer/templates/redis.json b/packer/templates/redis.json
deleted file mode 100644 (file)
index df687ad..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-{
-  "variables": {
-    "stack_tenant": null,
-    "stack_user": null,
-    "stack_pass": null,
-    "stack_network": null,
-
-    "base_image": null,
-    "cloud_user": null,
-    "distro": null,
-    "cloud_user_data": null
-  },
-  "builders": [
-    {
-      "type": "openstack",
-      "identity_endpoint": "https://auth.vexxhost.net/v2.0/",
-      "tenant_name": "{{user `stack_tenant`}}",
-      "username": "{{user `stack_user`}}",
-      "password": "{{user `stack_pass`}}",
-      "region": "ca-ymq-1",
-      "ssh_username": "{{user `cloud_user`}}",
-      "image_name": "{{user `distro`}} - redis - {{isotime \"20060102-1504\"}}",
-      "source_image_name": "{{user `base_image`}}",
-      "flavor": "v1-standard-1",
-      "availability_zone": "ca-ymq-2",
-      "networks": [
-        "{{user `stack_network`}}"
-      ],
-      "user_data_file": "{{user `cloud_user_data`}}"
-    }
-  ],
-  "provisioners": [
-    {
-      "type": "shell",
-      "inline": ["mkdir -p /tmp/packer"]
-    },
-    {
-      "type": "file",
-      "source": "provision/basebuild/",
-      "destination": "/tmp/packer"
-    },
-    {
-      "type": "shell",
-      "scripts": [
-        "provision/baseline.sh",
-        "provision/basebuild.sh",
-        "provision/redis-server.sh",
-        "provision/system_reseal.sh"
-      ],
-      "execute_command": "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi"
-    }
-  ]
-}