I have workflow that create 2 virtual machines on GCP. When virtual instance created I store output with external ip to variable. In next playbook i want to use all of my ip addresses in host section. My code is:
---
- name: Download and install jenkins
hosts:
- "{{ node_1_ip }}"
- "{{ node_2_ip }}"
tasks:
- name: Install java
yum:
name: java-1.8.0-openjdk-devel
become: true
But when I run my playbook i have warning:
[WARNING]: Could not match supplied host pattern, ignoring: 35.228.80.9
35.228.80.9 is my node_2_ip. How can I apply my playbook to this 2 machines?