Categories
Mastering Development System & Network

Ansible SSH connection closed

I have a little problem with ansible. I’m running it in a container: ansible 2.7.7 config file = /etc/ansible/ansible.cfg configured module search path = [‘/root/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’] ansible python module location = /usr/lib/python3/dist-packages/ansible executable location = /usr/bin/ansible python version = 3.7.3 (default, Dec 20 2019, 18:57:59) [GCC 8.3.0] I want to create an artefact in one […]

Categories
Development Plugins

how to become root then execute script remote

I met issue run remote script by ansible. I need run the remote script after become root (run sudo su -). ansible can’t take me to root by become_method in YML? is any config file issue or playbook command issue here ? [root@automation ansible]# ansible-playbook YML/disk_scan.yml -i hosts SSH password: PLAY [test] *********************************************************************************************************************************************************************************** TASK [copy] […]