16 lines
367 B
YAML
16 lines
367 B
YAML
---
|
|
- name: Configure /etc/hosts for all nodes
|
|
hosts: k8s
|
|
become: true
|
|
|
|
tasks:
|
|
- name: Add cluster nodes to /etc/hosts
|
|
blockinfile:
|
|
path: /etc/hosts
|
|
marker: "# {mark} k8s cluster nodes"
|
|
block: |
|
|
192.168.1.31 master01
|
|
192.168.1.35 worker01
|
|
192.168.1.36 worker02
|
|
192.168.1.37 worker03
|