kolla-ansible/ansible/roles/opendaylight/tasks/config.yml

198 lines
5.7 KiB
YAML

---
- name: Setting sysctl values
become: true
sysctl: name={{ item.name }} value={{ item.value }} sysctl_set=yes
with_items:
- { name: "net.bridge.bridge-nf-call-iptables", value: 1}
- { name: "net.bridge.bridge-nf-call-ip6tables", value: 1}
- { name: "net.ipv4.conf.all.rp_filter", value: 0}
- { name: "net.ipv4.conf.default.rp_filter", value: 0}
when:
- set_sysctl | bool
- inventory_hostname in groups['opendaylight']
- name: Ensuring config directories exist
file:
path: "{{ node_config_directory }}/{{ item }}"
state: "directory"
owner: "{{ config_owner_user }}"
group: "{{ config_owner_group }}"
mode: "0770"
become: true
with_items:
- "opendaylight"
- name: Copying over config.json files for services
template:
src: "{{ item }}.json.j2"
dest: "{{ node_config_directory }}/{{ item }}/config.json"
mode: "0660"
become: true
with_items:
- "opendaylight"
notify:
- Restart opendaylight container
- name: Copying over custom.properties
template:
src: "{{ role_path }}/templates/custom.properties.j2"
dest: "{{ node_config_directory }}/opendaylight/custom.properties"
mode: "0660"
become: true
notify:
- Restart opendaylight container
- name: Copying over start-odl
template:
src: "{{ role_path }}/templates/start-odl.j2"
dest: "{{ node_config_directory }}/opendaylight/start-odl"
mode: "0660"
become: true
notify:
- Restart opendaylight container
- name: Copying over jetty.xml
template:
src: "{{ role_path }}/templates/jetty.xml.j2"
dest: "{{ node_config_directory }}/{{ item }}/jetty.xml"
mode: "0660"
become: true
with_items:
- "opendaylight"
notify:
- Restart opendaylight container
- name: Copying over org.apache.karaf.features.cfg
template:
src: "{{ role_path }}/templates/org.apache.karaf.features.cfg.j2"
dest: "{{ node_config_directory }}/{{ item }}/org.apache.karaf.features.cfg"
mode: "0660"
become: true
with_items:
- "opendaylight"
notify:
- Restart opendaylight container
- name: Copying over org.opendaylight.ovsdb.library.cfg
template:
src: "{{ role_path }}/templates/org.opendaylight.ovsdb.library.cfg.j2"
dest: "{{ node_config_directory }}/{{ item }}/org.opendaylight.ovsdb.library.cfg"
mode: "0660"
become: true
with_items:
- "opendaylight"
notify:
- Restart opendaylight container
- name: Copying over tomcat-server.xml
template:
src: "{{ role_path }}/templates/tomcat-server.xml.j2"
dest: "{{ node_config_directory }}/{{ item }}/tomcat-server.xml"
mode: "0660"
become: true
with_items:
- "opendaylight"
notify:
- Restart opendaylight container
- name: Copying over org.ops4j.pax.logging.cfg.j2
template:
src: "{{ role_path }}/templates/org.ops4j.pax.logging.cfg.j2"
dest: "{{ node_config_directory }}/{{ item }}/org.ops4j.pax.logging.cfg"
mode: "0660"
become: true
with_items:
- "opendaylight"
notify:
- Restart opendaylight container
- name: Copying over netvirt-impl-config_netvirt-impl-config.xml
template:
src: "{{ role_path }}/templates/netvirt-impl-config_netvirt-impl-config.xml.j2"
dest: "{{ node_config_directory }}/{{ item }}/netvirt-impl-config_netvirt-impl-config.xml"
mode: "0660"
become: true
with_items:
- "opendaylight"
notify:
- Restart opendaylight container
- name: Copying over netvirt-aclservice-config.xml
template:
src: "{{ role_path }}/templates/netvirt-aclservice-config.xml.j2"
dest: "{{ node_config_directory }}/{{ item }}/netvirt-aclservice-config.xml"
mode: "0660"
become: true
with_items:
- "opendaylight"
notify:
- Restart opendaylight container
- name: Copying over setenv
template:
src: "{{ item }}"
dest: "{{ node_config_directory }}/opendaylight/setenv"
mode: "0660"
become: true
with_first_found:
- "{{ node_custom_config }}/opendaylight/{{ inventory_hostname }}/setenv"
- "{{ node_custom_config }}/opendaylight/setenv"
- "{{ role_path }}/templates/setenv.j2"
notify:
- Restart opendaylight container
- name: Copying over akka.conf
template:
src: "{{ item }}"
dest: "{{ node_config_directory }}/opendaylight/akka.conf"
mode: "0660"
become: true
with_first_found:
- "{{ node_custom_config }}/opendaylight/{{ inventory_hostname }}/akka.conf"
- "{{ node_custom_config }}/opendaylight/akka.conf"
- "akka.conf.j2"
notify:
- Restart opendaylight container
- name: Copying over modules.conf
template:
src: "{{ item }}"
dest: "{{ node_config_directory }}/opendaylight/modules.conf"
mode: "0660"
become: true
with_first_found:
- "{{ node_custom_config }}/opendaylight/{{ inventory_hostname }}/modules.conf"
- "{{ node_custom_config }}/opendaylight/modules.conf"
- "modules.conf.j2"
notify:
- Restart opendaylight container
- name: Copying over module-shards.conf
template:
src: "{{ item }}"
dest: "{{ node_config_directory }}/opendaylight/module-shards.conf"
mode: "0660"
become: true
with_first_found:
- "{{ node_custom_config }}/opendaylight/{{ inventory_hostname }}/module-shards.conf"
- "{{ node_custom_config }}/opendaylight/module-shards.conf"
- "module-shards.conf.j2"
notify:
- Restart opendaylight container
- name: Copying over 10-rest-connector.xml
template:
src: "{{ item }}"
dest: "{{ node_config_directory }}/opendaylight/10-rest-connector.xml"
mode: "0660"
become: true
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"
notify:
- Restart opendaylight container
- include_tasks: check-containers.yml
when: kolla_action != "config"