Skip to content

Commit

Permalink
Document the relationship between octal numbers and the leading zero
Browse files Browse the repository at this point in the history
  • Loading branch information
abadger committed Mar 26, 2018
1 parent a82fea6 commit 02f4417
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/ansible/utils/module_docs_fragments/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ class ModuleDocFragment(object):
options:
mode:
description:
- Mode the file or directory should be. For those used to I(/usr/bin/chmod) remember that modes are actually octal numbers (like C(0644) or C(01777)).
Leaving off the leading zero will likely have unexpected results.
As of version 1.8, the mode may be specified as a symbolic mode (for example, C(u+rwx) or C(u=rw,g=r,o=r)).
- "Mode the file or directory should be. For those used to I(/usr/bin/chmod) remember that modes are actually octal numbers.
You must either specify the leading zero so that Ansible's YAML parser knows it is an octal
number (like C(0644) or C(01777)) or quote it (like C('644') or C('0644') so Ansible
receives a string and can do its own conversion from string into number. Giving Ansible a number
without following one of these rules will end up with a decimal number which will have unexpected results.
As of version 1.8, the mode may be specified as a symbolic mode (for example, C(u+rwx) or C(u=rw,g=r,o=r))."
owner:
description:
- Name of the user that should own the file/directory, as would be fed to I(chown).
Expand Down

0 comments on commit 02f4417

Please sign in to comment.