相关疑难解决方法(0)

在 ansible 中成为非 root 用户失败

我正在尝试使用以下剧本在 ansible 中成为用户“oracle”:

- hosts: "myhost"
  tasks:         
        - name: install oracle client
          become: yes
          become_user: oracle
          become_method: su
          shell: |
                whoami
          args:
            chdir: /tmp/client
          environment:
            DISTRIB: /tmp/client
Run Code Online (Sandbox Code Playgroud)

我收到一个错误:

"msg": "Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user (rc: 1, err: chown: changing ownership of `/tmp/ansible-tmp-1513617986.78-246171259298529/': Operation not permitted\nchown: changing ownership of `/tmp/ansible-tmp-1513617986.78-246171259298529/command.py': Operation not permitted\n}). For information on working around this, see https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user"
Run Code Online (Sandbox Code Playgroud)

我有红色文章“ https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user

并将以下内容添加到/etc/ansible/ansible.cfg没有任何影响。

allow_world_readable_tmpfiles = …
Run Code Online (Sandbox Code Playgroud)

ansible

6
推荐指数
3
解决办法
8086
查看次数

标签 统计

ansible ×1