--- /dev/null
+- name: Create initial folder in Opendaylight
+ file:
+ path: /opt/opendaylight/configuration/initial
+ state: directory
+ mode: 0777
+
+- name: Add module-shards.conf file
+ template:
+ src: "module-shards.conf.j2"
+ dest: "/opt/opendaylight/configuration/initial/module-shards.conf"
+
+- name: Add akka.conf file
+ template:
+ src: "akka.conf.j2"
+ dest: "/opt/opendaylight/configuration/initial/akka.conf"
+
- name: Build Karaf feature list
set_fact:
- features: "{{ default_features + extra_features }}"
+ features: "{{ default_features + extra_features + cluster_features if cluster else default_features + extra_features }}"
- name: Configure ODL Karaf features
lineinfile:
---
- include: install_odl.yml
+- include: configure_cluster.yml
+ when:
+ - cluster
+
- include: configure_karaf_features.yml
- include: configure_nb_rest_port.yml
- include: open_nb_rest_port.yml
--- /dev/null
+# {{ ansible_managed }}
+
+{%- set odl_cluster_list = [] %}
+{% set vars = {'host_ip': None,'member_index': None} %}
+
+{% for host in groups["neutron_server_container"] %}
+ {% if inventory_hostname == host %}
+ {% set _ = vars.update({'host_ip': hostvars[host]['container_address']|string}) %}
+ {% set _ = vars.update({'member_index': '"' + "member-" + loop.index|string + '"'}) %}
+ {% endif %}
+ {% set ip_address = hostvars[host]['container_address']|string %}
+ {% set _ = odl_cluster_list.append('"' + "akka.tcp://opendaylight-cluster-data@" + ip_address + ":" + {{ akka_remoting_port }} + '"') %}
+{%- endfor %}
+
+odl-cluster-data {
+ akka {
+ remote {
+ artery {
+ enabled = off
+ canonical.hostname = "{{vars.host_ip}}"
+ canonical.port = { akka_remoting_port }}
+ }
+ netty.tcp {
+ hostname = "{{vars.host_ip}}"
+ port = { akka_remoting_port }}
+ }
+ # when under load we might trip a false positive on the failure detector
+ # transport-failure-detector {
+ # heartbeat-interval = 4 s
+ # acceptable-heartbeat-pause = 16s
+ # }
+ }
+
+ cluster {
+ # Remove ".tcp" when using artery.
+ seed-nodes = [{{ odl_cluster_list | join(',') }}]
+ roles = [
+ {{vars.member_index}}
+ ]
+
+ }
+
+ persistence {
+ # By default the snapshots/journal directories live in KARAF_HOME. You can choose to put it somewhere else by
+ # modifying the following two properties. The directory location specified may be a relative or absolute path.
+ # The relative path is always relative to KARAF_HOME.
+
+ # snapshot-store.local.dir = "target/snapshots"
+ # journal.leveldb.dir = "target/journal"
+
+ journal {
+ leveldb {
+ # Set native = off to use a Java-only implementation of leveldb.
+ # Note that the Java-only version is not currently considered by Akka to be production quality.
+
+ # native = off
+ }
+ }
+ }
+ }
+}
+
--- /dev/null
+# {{ ansible_managed }}
+
+{%- set members_list = [] %}
+
+{% for host in groups["neutron_server_container"] %}
+ {% set indexing = loop.index|string %}
+ {% set _ = members_list.append('"' + "member-" + indexing + '"') %}
+{% endfor %}
+
+module-shards = [
+ {
+ name = "default"
+ shards = [
+ {
+ name="default"
+ replicas = [
+ {{ members_list | join(',') }}
+ ]
+ }
+ ]
+ },
+ {
+ name = "topology"
+ shards = [
+ {
+ name="topology"
+ replicas = [
+ {{ members_list | join(',') }}
+ ]
+ }
+ ]
+ },
+ {
+ name = "inventory"
+ shards = [
+ {
+ name="inventory"
+ replicas = [
+ {{ members_list | join(',') }}
+ ]
+ }
+ ]
+ }
+]
+
# CLIs is an anti-goal for CI/CD and automated deployments generally.
extra_features: []
+# Deploying Opendaylight in a clustering mode is a feature
+# which is only supported when the current role is consumed
+# by the OSA project.
+# https://github.com/openstack/openstack-ansible
+
+# Enable or disable deploying OpenDaylight as a cluster.
+cluster: false
+
+# If OpenDaylight is deployed as a cluster, these features are required.
+cluster_features:
+ - 'odl-mdsal-clustering'
+ - 'odl-jolokia'
+
# Specifies the port for the ODL northbound REST interface to listen on.
# This was added because OpenStack's Swift project uses a conflicting port.
nb_rest_port: 8080
+# Specifies the port for the ODL clustering which is being used by Akka
+# remoting for east-west communication.
+akka_remoting_port: 2550
+
# Method to install ODL
# Valid options:
# rpm_repo: Install ODL using its Yum repo config