diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 1fcecc611f5b8982688598e393d5a8eb951df6b8..7dadedb1f20d12778bb87723d1edee6084b792e3 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -328,6 +328,7 @@ opendaylight_tomcat_redirect_port: "8663" opendaylight_karaf_ssh_port: "8101" opendaylight_openflow_port: "6653" opendaylight_ovsdb_port: "6641" +opendaylight_websocket_port: "8185" vitrage_api_port: "8999" diff --git a/ansible/roles/haproxy/templates/haproxy.cfg.j2 b/ansible/roles/haproxy/templates/haproxy.cfg.j2 index 81b8bcd2f9895cf09d84691e9f190baabc365cfc..dbeea9da72816339a6dd746bfcf0a8d8b06fc2c5 100644 --- a/ansible/roles/haproxy/templates/haproxy.cfg.j2 +++ b/ansible/roles/haproxy/templates/haproxy.cfg.j2 @@ -1330,4 +1330,11 @@ listen opendaylight_api_backup server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ opendaylight_restconf_port_backup }} check fall 5 inter 2000 rise 2 {% endfor %} +listen opendaylight_websocket + bind {{ kolla_internal_vip_address }}:{{ opendaylight_websocket_port }} + balance source +{% for host in groups['opendaylight'] %} + server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ opendaylight_websocket_port }} check fall 5 inter 2000 rise 2 +{% endfor %} + {% endif %} diff --git a/ansible/roles/opendaylight/handlers/main.yml b/ansible/roles/opendaylight/handlers/main.yml index 0a5f9eec70eae0f61486226c0b3bb0ae0f235750..683ade5631a3d5a718939acbc5d37edc9f8582d5 100644 --- a/ansible/roles/opendaylight/handlers/main.yml +++ b/ansible/roles/opendaylight/handlers/main.yml @@ -28,4 +28,5 @@ or opendaylight_config_akka | changed or opendaylight_config_modules | changed or opendaylight_config_module_shards | changed + or opendaylight_config_10_rest_connector | changed or check_opendaylight_containers | changed diff --git a/ansible/roles/opendaylight/tasks/config.yml b/ansible/roles/opendaylight/tasks/config.yml index 6ccdc3073fa31dc659aa868c77130e74250f6b10..69031d2606a35ab03e3c9bddddef369245fc2872 100644 --- a/ansible/roles/opendaylight/tasks/config.yml +++ b/ansible/roles/opendaylight/tasks/config.yml @@ -192,6 +192,18 @@ notify: - Restart opendaylight container +- name: Copying over 10-rest-connector.xml + template: + src: "{{ item }}" + dest: "{{ node_config_directory }}/opendaylight/10-rest-connector.xml" + with_first_found: + - "{{ node_custom_config }}/opendaylight/{{ inventory_hostname }}/10-rest-connector.xml" + - "{{ node_custom_config }}/opendaylight/10-rest-connector.xml" + - "10-rest-connector.xml.j2" + register: opendaylight_config_10_rest_connector + notify: + - Restart opendaylight container + - name: Check opendaylight containers kolla_docker: action: "compare_container" diff --git a/ansible/roles/opendaylight/templates/10-rest-connector.xml.j2 b/ansible/roles/opendaylight/templates/10-rest-connector.xml.j2 new file mode 100644 index 0000000000000000000000000000000000000000..427125f7d2e61ef04bbca34f8d72d766b68b8366 --- /dev/null +++ b/ansible/roles/opendaylight/templates/10-rest-connector.xml.j2 @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + +This program and the accompanying materials are made available under the +terms of the Eclipse Public License v1.0 which accompanies this distribution, +and is available at http://www.eclipse.org/legal/epl-v10.html +--> +<snapshot> + <configuration> + <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> + <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config"> + <!-- default OF-switch-connection-provider (port 6633) --> + <module> + <type xmlns:rest="urn:opendaylight:params:xml:ns:yang:controller:md:sal:rest:connector">rest:rest-connector-impl</type> + <name>rest-connector-default-impl</name> + <websocket-address>{{ hostvars[inventory_hostname]['ansible_' + hostvars[inventory_hostname]['api_interface']]['ipv4']['address'] }}</websocket-address> + <websocket-port>{{ opendaylight_websocket_port }}</websocket-port> + <dom-broker> + <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-broker-osgi-registry</type> + <name>dom-broker</name> + </dom-broker> + </module> + </modules> + + <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config"> + <service> + <type xmlns:rest="urn:opendaylight:params:xml:ns:yang:controller:md:sal:rest:connector">rest:rest-connector</type> + <instance> + <name>rest-connector-default</name> + <provider> + /modules/module[type='rest-connector-impl'][name='rest-connector-default-impl'] + </provider> + </instance> + </service> + </services> + </data> + </configuration> + <required-capabilities> + <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:rest:connector?module=opendaylight-rest-connector&revision=2014-07-24</capability> + </required-capabilities> +</snapshot> diff --git a/ansible/roles/opendaylight/templates/opendaylight.json.j2 b/ansible/roles/opendaylight/templates/opendaylight.json.j2 index e475b9cb15b84d24de65d68bd8bc7de85c7fb6ec..4bce8fde1c67466ed023cbd8f3e822dfe9e92f5b 100644 --- a/ansible/roles/opendaylight/templates/opendaylight.json.j2 +++ b/ansible/roles/opendaylight/templates/opendaylight.json.j2 @@ -78,6 +78,12 @@ "dest": "/opt/opendaylight/configuration/initial/module-shards.conf", "owner": "odl", "perm": "0600" + }, + { + "source": "{{ container_config_directory }}/10-rest-connector.xml", + "dest": "/opt/opendaylight/etc/opendaylight/karaf/10-rest-connector.xml", + "owner": "odl", + "perm": "0600" } ], "permissions": [