I’m new of the Ansible World, and for the moment i used just to hardening some linux systems using every time the command locally:
ansible path_to_my_playbook.yml
There is a way to run this commant to a remote computer? i tried adding a remote computer in the hosts files but or i make a mistake or it does not work
could you recommend some links that can help me? as far i will have time i will start more in details how ansible works…but now i have to hader lots of Linux systems
I'm new of the Ansible World, and for the moment i used just to hardening some linux systems using every time the command locally:
ansible path_to_my_playbook.yml
There is a way to run this commant to a remote computer? i tried adding a remote computer in the hosts files but or i make a mistake or it does not work
- name Secure become: yes hosts: secured roles: - ubuntu18,04-desktop.cis (downloaded by github)
in the hosts file i put
[secured] 192.168.1.126
fatal: [192.168.1.126]: UNREACHABLE! => {“changed”: false, “msg”: “Failed to connect to the host via ssh:”
but for the user account i use i don’t have any problem to ssh manually in that workstation, even without password because i have exported the key. however the problems seems that the ssh connection via ansible is not permitted. I suppose i have something to configure. but what?
Do you have ssh keys set up between the ansible control node and the host you are running this against? If not, you need to specify the username and password as well. -u is the switch for user and then you would need -k or - Kk as well, depending on whether you have sudoers set up to allow you to execute passwordless root access or not.