Add basic cloud-init setup for the simulator instance 21/109821/2
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>
Fri, 3 Jul 2020 12:27:52 +0000 (14:27 +0200)
committerMorgan Richomme <morgan.richomme@orange.com>
Fri, 3 Jul 2020 16:02:32 +0000 (16:02 +0000)
Change-Id: I456358ac26e4ab02d5989a9505541721553034fe
Issue-ID: INT-1649
Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
test/mocks/mass-pnf-sim/deployment/heat/cloud-config.yaml [new file with mode: 0644]
test/mocks/mass-pnf-sim/deployment/heat/heat.yaml

diff --git a/test/mocks/mass-pnf-sim/deployment/heat/cloud-config.yaml b/test/mocks/mass-pnf-sim/deployment/heat/cloud-config.yaml
new file mode 100644 (file)
index 0000000..73d9f09
--- /dev/null
@@ -0,0 +1,19 @@
+#cloud-config
+package_upgrade: true
+packages:
+  - apt-transport-https
+  - ca-certificates
+  - gnupg-agent
+  - software-properties-common
+  - docker-ce
+  - docker-ce-cli
+  - containerd.io
+# Docker's apt key needs to be injected early in the boot as 'apt' cloud-init
+#  module doesn't support configuring key from file
+bootcmd:
+  - [curl, "https://download.docker.com/linux/ubuntu/gpg", -o, /run/docker.key]
+  - [apt-key, add, /run/docker.key]
+apt:
+  sources:
+    docker:
+      source: "deb [arch=amd64] https://download.docker.com/linux/ubuntu $RELEASE stable"
index 7bc36dc..9664ea0 100644 (file)
@@ -18,6 +18,11 @@ parameters:
     type: string
     description: Id of a private network for instance interface
 resources:
+  config:
+    type: OS::Heat::SoftwareConfig
+    properties:
+      config:
+        get_file: cloud-config.yaml
   simulator_floating_ip:
     type: OS::Neutron::FloatingIP
     properties:
@@ -38,6 +43,9 @@ resources:
       networks:
         - network:
             get_param: instance_net_id
+      user_data_format: RAW
+      user_data:
+        get_resource: config
 outputs:
   simulator_instance_id:
     description: ID of the simulator instance