top of page
Writer's pictureDiniz 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



128 views0 comments

Recent Posts

See All

Fake Data in Python

If you are developing applications, testing your software, or just exploring Python's capabilities, you might have faced a situation...

Mobile | Secret Phone Codes

Our smartphones have become extensions of ourselves, facilitating much of our communication and storing troves of private data. If...

Mouse & Keyboard Bot

This article illustrates how to automate mouse and keyboard movements using pyautogui module in python. This module is not preloaded with...

Comments


bottom of page