%define COMPONENT flannel
%define RPM_NAME caas-%{COMPONENT}
%define RPM_MAJOR_VERSION 0.11.0
-%define RPM_MINOR_VERSION 10
+%define RPM_MINOR_VERSION 11
%define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION}
Name: %{RPM_NAME}
--- /dev/null
+---
+# 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"
# See the License for the specific language governing permissions and
# limitations under the License.
+- name: collect flannel interfaces
+ set_fact:
+ flannel_interfaces: "{{ hostvars.values() | json_query(interface_query) | unique | list }}"
+
- name: template Flannel DaemonSet file
template:
src: flannel-ds.yaml
+#jinja2: lstrip_blocks: True
{#
Copyright 2019 Nokia
args:
- --ip-masq
- --kube-subnet-mgr
- - --iface={{ networking.infra_internal.interface }}
+ {% for interface in flannel_interfaces | default([]) %}
+ - --iface={{ interface }}
+ {% endfor %}
securityContext:
privileged: true
env: