• Diniz Martins

Ansible | Some issues

In this post I want to share with you some problems that I was facing and that I managed to fix by searching on Google, making debugs and talking with friends.


#1) Problem to connect to devices using playbook:

fatal: [XXX]: UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. 
    "unreachable": true
}

Workaround: type those commands into your ansible:

mv /usr/bin/sleep /usr/bin/sleep.dist
ln -s /bin/true /usr/bin/sleep


#2) Problem to connect to devices with crypto:

"msg": "p must be exactly 1024, 2048, or 3072 bits long"

Workaround: Try this commands below:

ssh -o HostKeyAlgorithms=ssh-dss -c aes256-cbc login@ip-address

Inside the host file, insert:

ansible_ssh_common_args="-o HostKeyAlgorithms=ssh-dss -c aes256-cbc"

Make sure your router is using the same encryption as you are sending!



#3) Problem with ssh service:

root@DRM:/etc/ansible# service ssh status
 * sshd is not running

Workaround: Try to restart the process.

root@DRM:/etc/ansible# sudo service ssh start
 * Starting OpenBSD Secure Shell server sshd   
 [ OK ]
root@DRM:/etc/ansible# service ssh status
 * sshd is running

#4) Packages and commands to installation and complete operation of Ansible:


Ansible:

sudo apt install ansible
sudo apt-add-repository ppa:ansible/ansible
sudo apt install software-properties-common
sudo apt-add-repository --yes --update ppa:ansible/ansible
pip install ansible-lint

Python3:

apt install python3-pip
/usr/bin/python -m pip install --upgrade pip
sudo apt-get install python-setuptools
apt install -y python python3-pip sshpass tree
apt install python-cryptography

Others:

apt install paramiko
pip3 install scrapy
apt install sshpass
apt full-upgrade



31 views

Recent Posts

See All

Python | Subnet Ping

This script will ping and display status of all hosts in a subnet we provide. import subprocess import ipaddress from subprocess import Popen, PIPE subnet = input("Please enter the network: ") network

Sublist3r

Sublist3r is a python tool designed to enumerate subdomains of websites using OSINT. It helps penetration testers and bug hunters collect and gather subdomains for the domain they are targeting. Enume

Random MAC Generator

Use this online random MAC generator to generate a list of random MAC addresses in the format 0e:f6:5a:fb:7a:26. By default 10 random MAC addresses are generate, you can change this number below.