Question
Failed to create temporary directory, but three days passed, it works, Why?
Logs
TASK [Gathering Facts] *********************************************************
fatal: [xx.xx.xx.xx]: 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. Failed command was: ( umask 77 && mkdir -p \“echo ~/.ansible/tmp
\”&& mkdir \“echo ~/.ansible/tmp/ansible-tmp-1735211329.977632-19-3329418728590
\” && echo ansible-tmp-1735211329.977632-19-3329418728590=\“echo ~/.ansible/tmp/ansible-tmp-1735211329.977632-19-3329418728590
\” ), exited with result 1”, “unreachable”: true}
---
- name: Change IP address on RHEL Linux
hosts: "{{ myVM }}"
become: yes
vars:
new_ip: xxxxx
new_gateway: xxxxx
new_dns: xxxxxx
tasks:
- name: Get IP Information
command: ip a s
register: ip_info
ignore_errors: yes
- name: Display IP Information
debug:
var: ip_info.stdout_lines
- name: Change ip, gateway, dns
shell: |
CONNECTION_NAME=$(nmcli -t -f NAME connection show | head -n 1)
nmcli connection modify "$CONNECTION_NAME" ipv4.addresses {{ new_ip }}/24
nmcli connection modify "$CONNECTION_NAME" ipv4.gateway {{ new_gateway }}
nmcli connection modify "$CONNECTION_NAME" ipv4.dns {{ new_dns }}
nmcli connection up "$CONNECTION_NAME" &
async: 45
poll: 0