ESTABLISH CONNECTION FOR USER

Issue:

PLAYBOOK: site.yml *************************************************************
1 plays in /scm/etc/ansible/site.yml

PLAY [web-servers] *************************************************************

TASK [setup] *******************************************************************
<127.0.0.1> ESTABLISH CONNECTION FOR USER: root on PORT 2222 TO 127.0.0.1
fatal: [127.0.0.1]: UNREACHABLE! => {"changed": false, "msg": "[Errno 111] Connection refused", "unreachable": true}
        to retry, use: --limit @/scm/etc/ansible/site.retry

PLAY RECAP *********************************************************************
127.0.0.1                  : ok=0    changed=0    unreachable=1    failed=0

[root@vagrant-centos65]# vi inventory/dev
[root@vagrant-centos65]# ansible-playbook -vvvv -i /scm/inventory/dev /scm/etc/ansible/site.yml "--check"
Using /etc/ansible/ansible.cfg as config file
[DEPRECATION WARNING]: Instead of sudo/sudo_user, use become/become_user and make sure become_method is 'sudo' (default).
This feature will be removed in a future
release. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
Loaded callback default of type stdout, v2.0

PLAYBOOK: site.yml *************************************************************
1 plays in /scm/etc/ansible/site.yml

PLAY [web-servers] *************************************************************

TASK [setup] *******************************************************************
<127.0.0.1> ESTABLISH CONNECTION FOR USER: root on PORT 22 TO 127.0.0.1
fatal: [127.0.0.1]: UNREACHABLE! => {"changed": false, "msg": "No authentication methods available", "unreachable": true}
        to retry, use: --limit @/scm/etc/ansible/site.retry

PLAY RECAP *********************************************************************
127.0.0.1                  : ok=0    changed=0    unreachable=1    failed=0


Solutions: Just add the value as mention in dev host file and try it will work.

dev

local ansible_ssh_port=2222 ansible_ssh_host=127.0.0.1 ansible_connection=local

[web-servers]
127.0.0.1



No comments:

Post a Comment