Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use proper default cluster hostname and cluster IP address #8

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions roles/kube-proxy/tasks/main.yml
@@ -1,13 +1,13 @@
---
- name: Determine IP address of one master
shell: "dig {{ groups['nodes'][0] }} +short"
shell: "dig {{ groups['masters'][0] }} +short"
register: result
failed_when: (result.rc != 0 or result.stdout == "") and cluster_ip is undefined
delegate_to: 127.0.0.1

- set_fact:
cluster_ip: "{{ cluster_ip | default(result.stdout) }}"
cluster_hostname: "{{ cluster_hostname | default(groups['nodes'][0]) }}"
cluster_hostname: "{{ cluster_hostname | default(groups['masters'][0]) }}"
cluster_port: "{{ cluster_port | default('6443') }}"

- name: Download kube-proxy
Expand Down
4 changes: 2 additions & 2 deletions roles/kubelet/tasks/main.yml
@@ -1,12 +1,12 @@
- name: Determine IP address of one master
shell: "dig {{ groups['nodes'][0] }} +short"
shell: "dig {{ groups['masters'][0] }} +short"
register: result
failed_when: (result.rc != 0 or result.stdout == "") and cluster_ip is undefined
delegate_to: 127.0.0.1

- set_fact:
cluster_ip: "{{ cluster_ip | default(result.stdout) }}"
cluster_hostname: "{{ cluster_hostname | default(groups['nodes'][0]) }}"
cluster_hostname: "{{ cluster_hostname | default(groups['masters'][0]) }}"
cluster_port: "{{ cluster_port | default('6443') }}"

- name: Download kubelet
Expand Down