Member-only story

Ansible troubleshooting — Permission denied Errno 13

How to troubleshoot the Permission denied Errno 13 Ansible fatal error and workaround the problem using the privilege escalation on Ansible Playbook.

Luca Berton
3 min readFeb 22, 2022

Today we’re going to talk about Ansible troubleshooting, specifically about permission denied [Errno 13].
I’m Luca Berton and welcome to today’s episode of Ansible Pilot.

demo

How to troubleshoot the Ansible fatal error[Errno 13] Permission denied and fix in Ansible Playbook code.

error code

---
- name: set environment demo
hosts: all
gather_facts: false
vars:
os_environment:
- key: EDITOR
value: vi
tasks:
- name: customize /etc/environment
ansible.builtin.lineinline:
dest: "/etc/environment"
state: present
regexp: "^{{ item.key }}="
line: "{{ item.key }}={{ item.value }}"
with_items: "{{ os_environment }}"

error execution

ansible-pilot $ ansible-playbook -i virtualmachines/demo/inventory…

--

--

Luca Berton
Luca Berton

Written by Luca Berton

I help creative Automation DevOps, Cloud Engineer, System Administrator, and IT Professional to succeed with Ansible Technology to automate more things everyday

No responses yet