Merge "Update the template_version alias for all the templates to pike."
[apex-tripleo-heat-templates.git] / puppet / services / opendaylight-api.yaml
index 0ed9d20..af85f4a 100644 (file)
@@ -1,4 +1,4 @@
-heat_template_version: ocata
+heat_template_version: pike
 
 description: >
   OpenDaylight SDN Controller.
@@ -17,6 +17,10 @@ parameters:
     type: string
     description: The password for the opendaylight server.
     hidden: true
+  OpenDaylightConnectionProtocol:
+    description: L7 protocol used for REST access
+    type: string
+    default: 'http'
   OpenDaylightEnableDHCP:
     description: Knob to enable/disable ODL DHCP Server
     type: boolean
@@ -24,7 +28,7 @@ parameters:
   OpenDaylightFeatures:
     description: List of features to install with ODL
     type: comma_delimited_list
-    default: ["odl-netvirt-openstack","odl-netvirt-ui"]
+    default: ["odl-netvirt-openstack","odl-netvirt-ui","odl-jolokia"]
   OpenDaylightApiVirtualIP:
     type: string
     default: ''
@@ -42,6 +46,14 @@ parameters:
   DefaultPasswords:
     default: {}
     type: json
+  RoleName:
+    default: ''
+    description: Role name on which the service is applied
+    type: string
+  RoleParameters:
+    default: {}
+    description: Parameters specific to the role
+    type: json
 
 outputs:
   role_data:
@@ -55,11 +67,36 @@ outputs:
         opendaylight::extra_features: {get_param: OpenDaylightFeatures}
         opendaylight::enable_dhcp: {get_param: OpenDaylightEnableDHCP}
         opendaylight::odl_bind_ip: {get_param: [ServiceNetMap, OpendaylightApiNetwork]}
+        opendaylight::nb_connection_protocol: {get_param: OpenDaylightConnectionProtocol}
         tripleo.opendaylight_api.firewall_rules:
               '137 opendaylight api':
                 dport:
                   - {get_param: OpenDaylightPort}
                   - 6640
                   - 6653
+                  - 2550
       step_config: |
         include tripleo::profile::base::neutron::opendaylight
+      upgrade_tasks:
+        - name: Check if opendaylight is deployed
+          command: systemctl is-enabled opendaylight
+          tags: common
+          ignore_errors: True
+          register: opendaylight_enabled
+        - name: "PreUpgrade step0,validation: Check service opendaylight is running"
+          shell: /usr/bin/systemctl show 'opendaylight' --property ActiveState | grep '\bactive\b'
+          when: opendaylight_enabled.rc == 0
+          tags: step0,validation
+        - name: Stop opendaylight service
+          tags: step1
+          when: opendaylight_enabled.rc == 0
+          service: name=opendaylight state=stopped
+        - name: Removes ODL snapshots, data, journal directories
+          file:
+            state: absent
+            path: /opt/opendaylight/{{item}}
+          tags: step2
+          with_items:
+            - snapshots
+            - data
+            - journal