X-Git-Url: https://gerrit.akraino.org/r/gitweb?p=ta%2Fcaas-danm.git;a=blobdiff_plain;f=ansible%2Froles%2Fflannel%2Fdefaults%2Fmain.yaml;fp=ansible%2Froles%2Fflannel%2Fdefaults%2Fmain.yaml;h=61a737d6cf693dd2a2bb81bdaecd92de09969600;hp=0000000000000000000000000000000000000000;hb=d6e2ccbb58435154df04b91c9810ade8df929b3b;hpb=531bfda510814db14e51cf3db82330d67f6fbb37 diff --git a/ansible/roles/flannel/defaults/main.yaml b/ansible/roles/flannel/defaults/main.yaml new file mode 100644 index 0000000..61a737d --- /dev/null +++ b/ansible/roles/flannel/defaults/main.yaml @@ -0,0 +1,26 @@ +--- +# Copyright 2019 Nokia +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +attached_network_profile: "{{ hosts[ansible_hostname]['network_profiles'][0] }}" +attached_network_profile_data: "{{ hostvars[ansible_hostname]['network_profiles'][attached_network_profile] }}" +interface_net_mapping: "{{ attached_network_profile_data['interface_net_mapping'] }}" + +caas_oam_network: | + {% set bound_host_networks = [] %} + {% for host_networks in (interface_net_mapping.keys() | map('extract', interface_net_mapping)| list) %} + {% set _ = bound_host_networks.extend(host_networks) %} + {% endfor %} + {% if 'caas_oam' not in bound_host_networks %}infra_internal{% else %}caas_oam{% endif %} +interface_query: "[*].networking.{{ caas_oam_network | trim }}.interface"