Closed clbarnes closed 4 years ago
Try adding "become_user: root". All other configuration should fail as well since whole /etc/postfix is owned by root (checked on Ubuntu 16.04/18.04/20.04)
/etc # ls -la | grep postfix
drwxr-xr-x 5 root root 4096 Dec 3 2019 postfix
/etc # tree -ug postfix/
postfix/
├── [root root ] dynamicmaps.cf
├── [root root ] dynamicmaps.cf.d
├── [root root ] main.cf
├── [root root ] main.cf.proto
├── [root root ] makedefs.out
├── [root root ] master.cf
├── [root root ] master.cf.proto
├── [root root ] postfix-files
├── [root root ] postfix-files.d
├── [root root ] postfix-script
├── [root root ] post-install
└── [root root ] sasl
3 directories, 9 files
The task is part of a role, and the role called from a playbook which has become: yes
(which I understand defaults to becoming root): is that enough, or does it need to be specified in each task as well?
I've got it like this:
---
- hosts: postfix
become: yes
become_user: root
become_method: sudo
roles:
- postfix
and it's working with out any problems.
Config, in a task:
Traceback:
Seems to be a privilege escalation issue - any thoughts?