Skip to content

install bootstrap packages mkstemp (13: Permission denied) #63

Open
@patsevanton

Description

@patsevanton

Describe the bug

Could not create temporary file for /var/lib/apt/extended_states - mkstemp (13: Permission denied)

Run playbook from user with sudo without password

Playbook

---
- name: Install zabbix server and web
  hosts: zabbix
  become: true

  roles:
    - role: robertdebock.bootstrap

Output

TASK [robertdebock.bootstrap : install bootstrap packages (package)] *******************************************************************************************************************
Friday 01 April 2022  14:04:06 +0600 (0:00:01.796)       0:00:11.819 **********
failed: [zabbix] (item=python3) => changed=false
  ansible_loop_var: item
  item: python3
  msg: |-
    '/usr/bin/apt-mark manual python3' failed: E: Could not create temporary file for /var/lib/apt/extended_states - mkstemp (13: Permission denied)
    E: Failed to write temporary StateFile /var/lib/apt/extended_states
  rc: 100
  stderr: |-
    E: Could not create temporary file for /var/lib/apt/extended_states - mkstemp (13: Permission denied)
    E: Failed to write temporary StateFile /var/lib/apt/extended_states
  stderr_lines: <omitted>
  stdout: ''
  stdout_lines: <omitted>
failed: [zabbix] (item=sudo) => changed=false
  ansible_loop_var: item
  item: sudo
  msg: |-
    '/usr/bin/apt-mark manual sudo' failed: E: Could not create temporary file for /var/lib/apt/extended_states - mkstemp (13: Permission denied)
    E: Failed to write temporary StateFile /var/lib/apt/extended_states
  rc: 100
  stderr: |-
    E: Could not create temporary file for /var/lib/apt/extended_states - mkstemp (13: Permission denied)
    E: Failed to write temporary StateFile /var/lib/apt/extended_states
  stderr_lines: <omitted>
  stdout: ''
  stdout_lines: <omitted>
failed: [zabbix] (item=gnupg) => changed=false
  ansible_loop_var: item
  item: gnupg
  msg: |-
    '/usr/bin/apt-mark manual gnupg' failed: E: Could not create temporary file for /var/lib/apt/extended_states - mkstemp (13: Permission denied)
    E: Failed to write temporary StateFile /var/lib/apt/extended_states
  rc: 100
  stderr: |-
    E: Could not create temporary file for /var/lib/apt/extended_states - mkstemp (13: Permission denied)
    E: Failed to write temporary StateFile /var/lib/apt/extended_states
  stderr_lines: <omitted>
  stdout: ''
  stdout_lines: <omitted>

Environment

Version

ansible [core 2.12.2]
  python version = 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]

Server where ansible

cat /etc/*release*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"

Remote server

cat /etc/*release*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions