ansible/ansible-playbook version: 2.1.2.0
I have the following action in my playbook:
- name: Install cli (as well)
pip:
name: "{{ mycompany_pip_pkg }}"
umask: 0022
Why am I getting the following fatal error message even though I followed the docs for Ansible pip
module: http://docs.ansible.com/ansible/pip_module.html
Error:
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
Docs says:
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/ shows the following code:
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: The following syntax WORKS! but why the above one is not working?
- name: Install cli (as well)
pip: name="{{ mycompany_pip_pkg }}" umask=0022
UPDATE:
Question:
1) Why in Ansible pip
module, when name
property's value contains an invalid package name, then this module is failing for umask
property's value (which is correct in my case)?
Ansible expects arguments to modules in
key=value
format, even though the free-form (YAML style) arguments are still accepted but not recommended.From Conventions/Recommendations