mirror of
https://gitea.fenix-dev.com/fenix-gitea-admin/iac-ansible-private.git
synced 2025-10-27 16:53:04 +00:00
12 lines
403 B
YAML
12 lines
403 B
YAML
- name: Definir hostname único por ordem de inventário
|
|
hosts: workers
|
|
become: yes
|
|
tasks:
|
|
- name: Definir hostname como ubuntu-0, ubuntu-1, etc.
|
|
hostname:
|
|
name: "ubuntu-{{ ansible_play_hosts.index(inventory_hostname) }}"
|
|
|
|
- name: Join Kubernetes cluster
|
|
shell: "{{ hostvars['master1']['kubeadm_join_command'] }}"
|
|
when: hostvars['master1']['kubeadm_join_command'] is defined
|