Инвентаризация (inventory/dev)
Код: Выделить всё
[master]
headnode ansible_host=xxx.xx.xx.xxx
[workers]
node001 ansible_host=node001
node002 ansible_host=node002
node003 ansible_host=node003
node004 ansible_host=node004
[all:vars]
ansible_user=root
[workers:vars]
ansible_ssh_common_args='-o ProxyJump=root@xxx.xx.xx.xxx'
Код: Выделить всё
node00X | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": false,
"ping": "pong"
}
headnode | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": false,
"ping": "pong"
}
Код: Выделить всё
- name: Status Workers
hosts: workers
gather_facts: true
tasks:
- name: hostname
command: hostname
register: hostname
- name: hostname workers
debug: msg="{{ hostname }}"
ansible-playbook -i Inventory/dev playbooks/test.yml
Код: Выделить всё
TASK [Gathering Facts] ***************************************************************************************************************************************************************************************
ok: [node002]
ok: [node003]
ok: [node001]
Код: Выделить всё
ESTABLISH SSH CONNECTION FOR USER: root
SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="root"' -o ConnectTimeout=10 -o ProxyJump=root@xxx.xx.xx.xxx -o 'ControlPath="/home/user/.ansible/cp/ba0c33ed59"' -tt node004 '/bin/sh -c '"'"'/usr/libexec/platform-python /root/.ansible/tmp/ansible-tmp-1731335666.477472-3501-262350450854534/AnsiballZ_setup.py && sleep 0'"'"''
--> stuck indefinitely
Подробнее здесь: [url]https://stackoverflow.com/questions/79178111/slurm-cluster-connection-block-during-gathering-facts[/url]