]> review.fuel-infra Code Review - tools/sustaining.git/commitdiff
Add dev heat template and change default image 79/40779/1
authorVladimir Khlyunev <vkhlyunev@mirantis.com>
Mon, 18 Mar 2019 06:41:32 +0000 (10:41 +0400)
committerVladimir Khlyunev <vkhlyunev@mirantis.com>
Mon, 18 Mar 2019 06:41:32 +0000 (10:41 +0400)
Change-Id: Icfa51131f03b49fb124d0d6cfe598a537a79b5b4

maintenance-ci/common/data/jenkins-slave.yml
maintenance-ci/common/data/mos-dev-slave.yml [new file with mode: 0644]
maintenance-ci/common/data/mos-slave.yml

index 5896e468a8c032dc7a95d707d55cdb8f385bff73..4843112bb42c9531776a508b3267112635362888 100644 (file)
@@ -9,7 +9,7 @@ parameters:
   image:
     type: string
     description: Name of image to use for servers
-    default: xenial-server-cloudimg-amd64-qcow
+    default: maintenance-ci-base-image
   flavor:
     type: string
     description: Flavor to use for servers
diff --git a/maintenance-ci/common/data/mos-dev-slave.yml b/maintenance-ci/common/data/mos-dev-slave.yml
new file mode 100644 (file)
index 0000000..e08c778
--- /dev/null
@@ -0,0 +1,89 @@
+
+heat_template_version: 2017-09-01
+
+parameters:
+  key_name:
+    type: string
+    description: Name of keypair to assign to servers
+    default: maintenance-ci-public-key
+  image:
+    type: string
+    description: Name of image to use for servers
+    default: maintenance-ci-mos-image
+  flavor:
+    type: string
+    description: Flavor to use for servers
+  private_net:
+    type: string
+    description: >
+      ID or name of public network for which floating IP addresses will be allocated
+    default: maintenance-ci-network
+  private_subnet:
+    type: string
+    default: maintenance-ci-subnet
+    description: Id of the private sub network for the compute server
+  public_net:
+    type: string
+    default: public
+    description: Id of the public network for the compute server
+  jenkins_labels:
+    type: string
+    default: ''
+    description: List of labels for jenkins swarm agent separated by whitespace
+
+resources:
+
+  wait_condition:
+    type: OS::Heat::WaitCondition
+    properties:
+      handle: {get_resource: wait_handle}
+      count: 1
+      timeout: 300
+
+  wait_handle:
+    type: OS::Heat::WaitConditionHandle
+
+  public_port:
+    type: OS::Neutron::Port
+    properties:
+      network_id: { get_param: private_net }
+      fixed_ips:
+      - subnet_id: { get_param: private_subnet }
+      security_groups:
+      - dc56d304-e75e-437a-8ef5-656f9bfcd2a0
+
+  floating_ip:
+    type: OS::Neutron::FloatingIP
+    properties:
+      floating_network_id: { get_param: public_net }
+      port_id: { get_resource: public_port }
+
+  node:
+    type: OS::Nova::Server
+    properties:
+      image: { get_param: image }
+      availability_zone: nova
+      flavor: { get_param: flavor }
+      key_name: { get_param: key_name }
+      networks:
+        - port: { get_resource: public_port }
+      user_data:
+        str_replace:
+          template: |
+            #!/bin/bash
+            mkdir -p /etc/jenkins-agent/
+            echo "LABELS" > /etc/jenkins-agent/labels
+            echo "127.0.0.1 $(hostname)" >> /etc/hosts
+            echo "FLOATING" > /etc/jenkins-agent/description
+            service jenkins-swarm-agent restart
+            wc_notify --data-binary '{"status": "SUCCESS"}'
+          params:
+           LABELS: {get_param: jenkins_labels}
+           wc_notify: { get_attr: [wait_handle, curl_cli] }
+           FLOATING: { get_attr: [ floating_ip, floating_ip_address ] }
+
+
+outputs:
+  floating_ip:
+      description: Floating IP
+      value: { get_attr: [ floating_ip, floating_ip_address ] }
index 5896e468a8c032dc7a95d707d55cdb8f385bff73..4bc88f84caa19b1a09f4ff8acc1ac8f2c2aa9227 100644 (file)
@@ -9,7 +9,7 @@ parameters:
   image:
     type: string
     description: Name of image to use for servers
-    default: xenial-server-cloudimg-amd64-qcow
+    default: maintenance-ci-mos-image
   flavor:
     type: string
     description: Flavor to use for servers