From: Michal Zegan Date: Wed, 19 Jun 2019 12:41:38 +0000 (+0200) Subject: Specify source ip for rancher agent X-Git-Tag: 6.0.0-ONAP~119^2~1 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=0ca158b61574f50d16b9e472d29ee1f3e2d19dfa;p=oom%2Foffline-installer.git Specify source ip for rancher agent This change explicitly sets cluster_ip as rancher agent source ip. This avoids eventual problems with ip autodetection, especially that we know the correct ip. Change-Id: I473f022c56301cefeb98ccb5bb94d78e7ac491a7 Issue-ID: OOM-1906 Signed-off-by: Michal Zegan --- diff --git a/ansible/roles/rancher/molecule/default/playbook.yml b/ansible/roles/rancher/molecule/default/playbook.yml index 436f2ff4..afdbb4af 100644 --- a/ansible/roles/rancher/molecule/default/playbook.yml +++ b/ansible/roles/rancher/molecule/default/playbook.yml @@ -10,6 +10,7 @@ - name: Converge rancher agent hosts: kubernetes roles: + - prepare-common - role: rancher vars: mode: agent diff --git a/ansible/roles/rancher/tasks/rancher_agent.yml b/ansible/roles/rancher/tasks/rancher_agent.yml index 73d9a642..e54d760e 100644 --- a/ansible/roles/rancher/tasks/rancher_agent.yml +++ b/ansible/roles/rancher/tasks/rancher_agent.yml @@ -4,6 +4,8 @@ name: rancher_agent image: "{{ server_hostvars.rancher_agent_image }}" command: "{{ server_hostvars.rancher_agent_reg_url }}" + env: + CATTLE_AGENT_IP: "{{ cluster_ip }}" volumes: - "/var/run/docker.sock:/var/run/docker.sock" - "/var/lib/rancher:/var/lib/rancher"