kolla-ansible/ansible/roles/opendaylight/tasks/config.yml
Mark Goddard a4bb8567da Fix up config file permissions on the host
Several config file permissions are incorrect on the host. In general,
files should be 0660, and directories and executables 0770.

Change-Id: Id276ac1864f280554e98b937f2845bb424d521de
Closes-Bug: #1821579
2019-04-02 17:23:31 +01:00

230 lines
6.9 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
register: opendaylight_config_json
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
register: opendaylight_config_custom_props
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
register: opendaylight_config_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
register: opendaylight_config_jetty
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
register: opendaylight_config_features
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
register: opendaylight_config_ovsdb
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
register: opendaylight_config_tomcat
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
register: opendaylight_config_logging
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
register: opendaylight_config_netvirt
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
register: opendaylight_config_netvirt_acl
with_items:
- "opendaylight"
notify:
- Restart opendaylight container
- name: Copying over setenv
template:
src: "{{ item }}"
dest: "{{ node_config_directory }}/opendaylight/setenv"
mode: "0660"
become: true
register: opendaylight_config_env
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"
register: opendaylight_config_akka
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"
register: opendaylight_config_modules
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"
register: opendaylight_config_module_shards
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"
register: opendaylight_config_10_rest_connector
notify:
- Restart opendaylight container
- name: Check opendaylight containers
become: true
kolla_docker:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
tty: "{{ item.value.tty }}"
register: check_opendaylight_containers
when:
- kolla_action != "config"
- item.value.enabled | bool
- item.value.host_in_groups | bool
with_dict: "{{ opendaylight_services }}"
notify:
- "Restart {{ item.key }} container"