diff --git a/roles/network_plugin/calico/tasks/install.yml b/roles/network_plugin/calico/tasks/install.yml index 1d785436a..7c8ce8a31 100644 --- a/roles/network_plugin/calico/tasks/install.yml +++ b/roles/network_plugin/calico/tasks/install.yml @@ -138,6 +138,8 @@ - name: Calico | Configure calico network pool command: cmd: "{{ bin_dir }}/calicoctl.sh apply -f -" + stdin: "{{ stdin | to_json }}" + vars: stdin: > { "kind": "IPPool", "apiVersion": "projectcalico.org/v3", @@ -171,6 +173,8 @@ - name: Calico | Set up BGP Configuration command: cmd: "{{ bin_dir }}/calicoctl.sh apply -f -" + stdin: "{{ stdin | to_json }}" + vars: stdin: > { "kind": "BGPConfiguration", "apiVersion": "projectcalico.org/v3", @@ -181,7 +185,7 @@ "logSeverityScreen": "Info", {% if not calico_no_global_as_num|default(false) %}"asNumber": {{ global_as_num }},{% endif %} "nodeToNodeMeshEnabled": {{ nodeToNodeMeshEnabled|default('true') }} , - {% if calico_advertise_cluster_ips|default(false) %}"serviceClusterIPs": [{"cidr": {{ kube_service_addresses }} }],{% endif %} + {% if calico_advertise_cluster_ips|default(false) %}"serviceClusterIPs": [{"cidr": "{{ kube_service_addresses }}" }],{% endif %} "serviceExternalIPs": {{ _service_external_ips|default([]) }} }} changed_when: false when: @@ -190,6 +194,8 @@ - name: Calico | Configure peering with router(s) at global scope command: cmd: "{{ bin_dir }}/calicoctl.sh apply -f -" + stdin: "{{ stdin | to_json }}" + vars: stdin: > {"apiVersion": "projectcalico.org/v3", "kind": "BGPPeer", @@ -213,6 +219,8 @@ - name: Calico | Configure peering with route reflectors at global scope command: cmd: "{{ bin_dir }}/calicoctl.sh apply -f -" + stdin: "{{ stdin | to_json }}" + vars: stdin: > {"apiVersion": "projectcalico.org/v3", "kind": "BGPPeer", @@ -236,6 +244,8 @@ - name: Calico | Configure route reflectors to peer with each other command: cmd: "{{ bin_dir }}/calicoctl.sh apply -f -" + stdin: "{{ stdin | to_json }}" + vars: stdin: > {"apiVersion": "projectcalico.org/v3", "kind": "BGPPeer", @@ -310,6 +320,8 @@ - name: Calico | Configure node asNumber for per node peering command: cmd: "{{ bin_dir }}/calicoctl.sh apply -f -" + stdin: "{{ stdin | to_json }}" + vars: stdin: > {"apiVersion": "projectcalico.org/v3", "kind": "Node", @@ -335,6 +347,8 @@ - name: Calico | Configure peering with router(s) at node scope command: cmd: "{{ bin_dir }}/calicoctl.sh apply -f -" + stdin: "{{ stdin | to_json }}" + vars: stdin: > {"apiVersion": "projectcalico.org/v3", "kind": "BGPPeer",