Skip to content
Snippets Groups Projects
Unverified Commit 88bee6c6 authored by forselli-stratio's avatar forselli-stratio Committed by GitHub
Browse files

Fix ansible calico route reflector tasks in calico role (#7224)

* Fix calico-rr tasks

* revert stdin only when it's already a string
parent 1f84d634
Branches
Tags
No related merge requests found
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
- name: Calico | Configure calico network pool - name: Calico | Configure calico network pool
command: command:
cmd: "{{ bin_dir }}/calicoctl.sh apply -f -" cmd: "{{ bin_dir }}/calicoctl.sh apply -f -"
stdin: "{{ stdin | to_json }}" stdin: "{{ stdin is string | ternary(stdin, stdin|to_json) }}"
vars: vars:
stdin: > stdin: >
{ "kind": "IPPool", { "kind": "IPPool",
...@@ -173,7 +173,7 @@ ...@@ -173,7 +173,7 @@
- name: Calico | Set up BGP Configuration - name: Calico | Set up BGP Configuration
command: command:
cmd: "{{ bin_dir }}/calicoctl.sh apply -f -" cmd: "{{ bin_dir }}/calicoctl.sh apply -f -"
stdin: "{{ stdin | to_json }}" stdin: "{{ stdin is string | ternary(stdin, stdin|to_json) }}"
vars: vars:
stdin: > stdin: >
{ "kind": "BGPConfiguration", { "kind": "BGPConfiguration",
...@@ -194,7 +194,7 @@ ...@@ -194,7 +194,7 @@
- name: Calico | Configure peering with router(s) at global scope - name: Calico | Configure peering with router(s) at global scope
command: command:
cmd: "{{ bin_dir }}/calicoctl.sh apply -f -" cmd: "{{ bin_dir }}/calicoctl.sh apply -f -"
stdin: "{{ stdin | to_json }}" stdin: "{{ stdin is string | ternary(stdin, stdin|to_json) }}"
vars: vars:
stdin: > stdin: >
{"apiVersion": "projectcalico.org/v3", {"apiVersion": "projectcalico.org/v3",
...@@ -219,7 +219,8 @@ ...@@ -219,7 +219,8 @@
- name: Calico | Configure peering with route reflectors at global scope - name: Calico | Configure peering with route reflectors at global scope
command: command:
cmd: "{{ bin_dir }}/calicoctl.sh apply -f -" cmd: "{{ bin_dir }}/calicoctl.sh apply -f -"
stdin: "{{ stdin | to_json }}" # revert when it's already a string
stdin: "{{ stdin is string | ternary(stdin, stdin|to_json) }}"
vars: vars:
stdin: > stdin: >
{"apiVersion": "projectcalico.org/v3", {"apiVersion": "projectcalico.org/v3",
...@@ -244,7 +245,8 @@ ...@@ -244,7 +245,8 @@
- name: Calico | Configure route reflectors to peer with each other - name: Calico | Configure route reflectors to peer with each other
command: command:
cmd: "{{ bin_dir }}/calicoctl.sh apply -f -" cmd: "{{ bin_dir }}/calicoctl.sh apply -f -"
stdin: "{{ stdin | to_json }}" # revert when it's already a string
stdin: "{{ stdin is string | ternary(stdin, stdin|to_json) }}"
vars: vars:
stdin: > stdin: >
{"apiVersion": "projectcalico.org/v3", {"apiVersion": "projectcalico.org/v3",
...@@ -320,7 +322,7 @@ ...@@ -320,7 +322,7 @@
- name: Calico | Configure node asNumber for per node peering - name: Calico | Configure node asNumber for per node peering
command: command:
cmd: "{{ bin_dir }}/calicoctl.sh apply -f -" cmd: "{{ bin_dir }}/calicoctl.sh apply -f -"
stdin: "{{ stdin | to_json }}" stdin: "{{ stdin is string | ternary(stdin, stdin|to_json) }}"
vars: vars:
stdin: > stdin: >
{"apiVersion": "projectcalico.org/v3", {"apiVersion": "projectcalico.org/v3",
...@@ -347,7 +349,7 @@ ...@@ -347,7 +349,7 @@
- name: Calico | Configure peering with router(s) at node scope - name: Calico | Configure peering with router(s) at node scope
command: command:
cmd: "{{ bin_dir }}/calicoctl.sh apply -f -" cmd: "{{ bin_dir }}/calicoctl.sh apply -f -"
stdin: "{{ stdin | to_json }}" stdin: "{{ stdin is string | ternary(stdin, stdin|to_json) }}"
vars: vars:
stdin: > stdin: >
{"apiVersion": "projectcalico.org/v3", {"apiVersion": "projectcalico.org/v3",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment