mirror of https://github.com/k3s-io/k3s
12 lines
333 B
YAML
12 lines
333 B
YAML
![]() |
- hosts: all
|
||
|
sudo: yes
|
||
|
tasks:
|
||
|
- name: "Build hosts file"
|
||
|
lineinfile:
|
||
|
dest=/etc/hosts
|
||
|
regexp=".*{{ item }}$"
|
||
|
line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}"
|
||
|
state=present
|
||
|
when: hostvars[item].ansible_default_ipv4.address is defined
|
||
|
with_items: groups['all']
|