I am trying to configure one set of hosts [nodes] using facts from another set of hosts [etcd]. Here is my hosts file
[master] kubernetes ansib
If you want to use facts of some host, you should gather them first.
Run setup
task on [etcd] hosts to populate hostvars
.
---
- name: Gather etcd facts
hosts: etcd
tasks:
- setup:
- name: Configure common
hosts: nodes
sudo: True
tasks:
- name: etcd endpoints
file: dest=/etc/kubernetes state=directory
- name: etcd endpoints
template: src=files/k.j2 dest=/etc/kubernetes/apiserver