Created
October 6, 2016 18:40
-
-
Save v1k0d3n/142bbe4b2508eb75cfc851f62d6d5f7b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PLAY [all] ********************************************************************* | |
TASK [setup] ******************************************************************* | |
ok: [kube2] | |
ok: [kube3] | |
ok: [kube1] | |
TASK [kube-join : collect api endpoints from kubernetes masters] *************** | |
changed: [kube2 -> None] => (item=kube1) | |
changed: [kube1 -> None] => (item=kube1) | |
changed: [kube3 -> None] => (item=kube1) | |
TASK [kube-join : setting fact for master api endpoints] *********************** | |
ok: [kube1] | |
ok: [kube2] | |
ok: [kube3] | |
TASK [kube-join : kubernetes master api endpoints] ***************************** | |
[DEPRECATION WARNING]: Using bare variables is deprecated. Update your | |
playbooks so that the environment value uses the full variable syntax | |
('{{kube_api_endpoint.result}}'). | |
This feature will be removed in a future | |
release. Deprecation warnings can be disabled by setting | |
deprecation_warnings=False in ansible.cfg. | |
[DEPRECATION WARNING]: Using bare variables is deprecated. Update your | |
playbooks so that the environment value uses the full variable syntax | |
('{{kube_api_endpoint.result}}'). | |
This feature will be removed in a future | |
release. Deprecation warnings can be disabled by setting | |
deprecation_warnings=False in ansible.cfg. | |
[DEPRECATION WARNING]: Skipping task due to undefined Error, in the future this | |
will be a fatal error.: 'dict object' has no attribute 'result'. | |
This feature | |
will be removed in a future release. Deprecation warnings can be disabled by | |
setting deprecation_warnings=False in ansible.cfg. | |
[DEPRECATION WARNING]: Skipping task due to undefined Error, in the future this | |
will be a fatal error.: 'dict object' has no attribute 'result'. | |
This feature | |
will be removed in a future release. Deprecation warnings can be disabled by | |
setting deprecation_warnings=False in ansible.cfg. | |
[DEPRECATION WARNING]: Using bare variables is deprecated. Update your | |
playbooks so that the environment value uses the full variable syntax | |
('{{kube_api_endpoint.result}}'). | |
This feature will be removed in a future | |
release. Deprecation warnings can be disabled by setting | |
deprecation_warnings=False in ansible.cfg. | |
[DEPRECATION WARNING]: Skipping task due to undefined Error, in the future this | |
will be a fatal error.: 'dict object' has no attribute 'result'. | |
This feature | |
will be removed in a future release. Deprecation warnings can be disabled by | |
setting deprecation_warnings=False in ansible.cfg. | |
ok: [kube1] => { | |
"item.stdout": "VARIABLE IS NOT DEFINED!" | |
} | |
ok: [kube2] => { | |
"item.stdout": "VARIABLE IS NOT DEFINED!" | |
} | |
ok: [kube3] => { | |
"item.stdout": "VARIABLE IS NOT DEFINED!" | |
} | |
PLAY RECAP ********************************************************************* | |
kube1 : ok=15 changed=3 unreachable=0 failed=0 | |
kube2 : ok=10 changed=1 unreachable=0 failed=0 | |
kube3 : ok=10 changed=1 unreachable=0 failed=0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: collect api endpoints from kubernetes masters | |
shell: ip addr show {{ public_iface }} | grep "inet\b" | awk '{print $2}' | cut -d/ -f1 | |
delegate_to: "{{ item }}" | |
delegate_facts: true | |
with_items: "{{ groups['kube-masters'] }}" | |
register: kube_api_endpoint_fact | |
# when: inventory_hostname in groups['kube-workers'] | |
- name: setting fact for master api endpoints | |
set_fact: | |
kube_api_endpoint: "{{ kube_api_endpoint_fact }}" | |
#- name: collect api endpoint from masters | |
# shell: ip addr show {{ public_iface }} | grep "inet\b" | awk '{print $2}' | cut -d/ -f1 | |
# register: kube_api_endpoint | |
# when: inventory_hostname in groups['kube-masters'] | |
- name: kubernetes master api endpoints | |
debug: var=item.stdout | |
with_items: kube_api_endpoint.result | |
# when: inventory_hostname in groups['kube-workers'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment