小编Dea*_*nMV的帖子

使用become/become_user的Ansible 2.1.0无法设置临时文件的权限

我的服务器上有一个ansible 2.1.0,我通过vagrant和PC 进行部署."部署"角色具有:

- name: upload code
  become: true
  become_user: www-data
  git: repo=git@bitbucket.org:****.git
     dest=/var/www/main
     key_file=/var/www/.ssh/id_rsa
     accept_hostkey=true
     update=yes
     force=yes
 register: fresh_code
 notify: restart php-fpm
 tags: fresh_code
Run Code Online (Sandbox Code Playgroud)

在这种情况下使用ansible 2.1.0我收到一个错误:

fatal: [default]: FAILED! => {"failed": true, "msg": "Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user. For information on working around this, see https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user"}
Run Code Online (Sandbox Code Playgroud)

我在我的电脑上使用它的2.0.1.0,通常都是 - 文件夹/ var/www /有文件夹主要与所有者和组www-data

如果我只使用become_user:www-data,如果我使用become_method:sudo with become_user:www-data - 我得到了同样的错误

需要做些什么来解决这个问题?

git sudo vagrant ansible ansible-2.x

29
推荐指数
2
解决办法
1万
查看次数

centos7上安装mitmproxy

我在 centos7 x64 上安装 mitmproxy 时遇到问题。我已经在我的操作系统上安装了:

  • 软件包 libxslt-devel-1.1.28-5.el7.x86_64 已安装并且是最新版本
  • 软件包 libxml2-devel-2.9.1-5.el7_1.2.x86_64 已安装并且是最新版本
  • 软件包 libxml2-devel-2.9.1-5.el7_1.2.x86_64 已安装并且是最新版本
  • 软件包 libxslt-devel-1.1.28-5.el7.x86_64 已安装并且是最新版本
  • [root@localhost ~]# python -V > Python 2.7.3
  • 软件包 libffi-devel-3.0.13-11.el7.x86_64 已安装并且是最新版本
  • 软件包 python-urllib3-1.10.2-2.el7_1.noarch 已安装并且是最新版本
  • 软件包 python-pillow-2.0.0-17.gitd1c6db8.el7.x86_64 已安装且最新版本

错误是:

[root@localhost ~]# pip install mitmproxy 
 Failed building wheel for Pillow
Failed to build Pillow
Installing collected packages: Pillow, construct, html2text, mitmproxy
Running setup.py install for Pillow
Complete output from command /usr/local/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-JmmUK9/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-sQcNE2-record/install-record.txt --single-version-externally-managed --compile: …
Run Code Online (Sandbox Code Playgroud)

pip python-imaging-library mitmproxy centos7

5
推荐指数
1
解决办法
4213
查看次数