我正在運行以下任務,在使用Ansible 2.1的ubuntu 14操作系統上運行debian軟件包,但在下面複製了異常。遠程用戶在遠程機器上具有sudo權限。在遠程服務器上的可靠特權問題
- name: run dpkg
shell: dpkg -i {{ debian_build.stdout }}
become: true
become_user: ubuntu
become_method: sudo
錯誤
fatal: [testserver]: FAILED! => {"changed": true, "cmd": "dpkg -i /home/ubuntu/test-server_0.1.0-7c47d103f8da21045e3ee817529eb84a0aa79723_all.deb", "delta": "0:00:00.002444", "end": "2016-10-10 14:33:32.014887", "failed": true, "rc": 2, "start": "2016-10-10 14:33:32.012443", "stderr": "dpkg: error: requested operation requires superuser privilege", "stdout": "", "stdout_lines": [], "warnings": []}
我能夠運行它作爲sudo dpkg -i {{debian_build.stdout}}。想知道爲什麼成爲部分沒有被使用 –