seems like not working for me, not sure if i'm missing anything here...
cat playbook1.yaml
---
- hosts: localhost
connection: local
become: yes
gather_facts: true
tasks:
- name: load var
include_vars: sites.yaml
- name: site_facts
set_fact:
sites: "{{ item }}"
loop: "{{ site_int }}"
- name: local_ip_fact
set_stats:
data:
local_ip: "{{ sites[site]['peer_ip'] | ipaddr('address') }}"
when: "site in sites.keys()"
cat master.yaml:
---
- import_playbook: slave.yaml
- hosts: localhost
gather_facts: false
tasks:
- debug:
msg: "{{ local_ip }}"
so basically i need to pass this local_ip, variable from palybook1 to master....but it gives me error about undefined variable...