ansible/ansible-剧本版本:2.1.2.0Ansible PIP模块:名称包和的umask 0022致命错误:无效字面对于int()与基座8: '18' 的umask必须是一个八进制整数
我有在我的剧本了以下行动:
- name: Install cli (as well)
pip:
name: "{{ mycompany_pip_pkg }}"
umask: 0022
为什么会收到以下致命错误消息,即使我遵循Ansible pip
模块文档:http://docs.ansible.com/ansible/pip_module.html
错误:
个TASK [company.company-ansible : Install cli (as well)] ****************
fatal: [localhost]: FAILED! => {"changed": false, "details": "invalid literal for int() with base 8: '18'", "failed": true, "msg": "umask must be an octal integer"}
Ansible pip
文件说:
The system umask to apply before installing the pip package. This is useful, for example, when installing on systems that have a very restrictive umask by default (e.g., 0077) and you want to pip install packages which are to be used by all users. Note that this requires you to specify desired umask mode in octal, with a leading 0 (e.g., 0077).
http://programtalk.com/vs2/python/749/ansible-modules-core/packaging/language/pip.py/显示下面的代码:
if umask and not isinstance(umask, int):
try:
umask = int(umask, 8)
except Exception:
module.fail_json(msg="umask must be an octal integer",
details=to_native(sys.exc_info()[1]))
PS:以下语法的作品!但为什么上面的一个不工作?
- name: Install cli (as well)
pip: name="{{ mycompany_pip_pkg }}" umask=0022
UPDATE:
问题:
1)为什么在Ansible pip
模块,当name
属性的值包含无效的包名,那么这个模块失败的umask
属性的值(这是正确的,我案件)?
好吧,我找到了解决方案,但仍然,为什么第一节的语法不工作! –