Приветствую.
Хочу нодам выдавать имена с порядковым номером, но чёт ни как(
---
- name: Increment variable
set_fact: node_number={{ node_number | int + 1 }}
- name: Change node hostname
hostname:
name: "{{ hostname_node }}{{ node_number }}"
в итоге
TASK [kubernetes/node : Increment variable] ******************************************************************************************
task path: ~/roles/kubernetes/node/tasks/main.yml:2
Friday 31 May 2019 17:34:43 +0300 (0:00:01.000) 0:00:23.367 ************
ok: [10.100.100.181] => {"ansible_facts": {"node_number": "1"}, "changed": false}
ok: [10.100.100.182] => {"ansible_facts": {"node_number": "1"}, "changed": false}
TASK [kubernetes/node : Cheange node hostname] ***************************************************************************************
task path: ~/roles/kubernetes/node/tasks/main.yml:5
Friday 31 May 2019 17:34:44 +0300 (0:00:00.062) 0:00:23.430 ************
ok: [10.100.100.181] => {"ansible_facts": {"ansible_domain": "", "ansible_fqdn": "k8s-n1", "ansible_hostname": "k8s-n1", "ansible_nodename": "k8s-n1"}, "changed": false, "name": "k8s-n1"}
ok: [10.100.100.182] => {"ansible_facts": {"ansible_domain": "", "ansible_fqdn": "k8s-n1", "ansible_hostname": "k8s-n1", "ansible_nodename": "k8s-n1"}, "changed": false, "name": "k8s-n1"}