Open shaunsmiley-xevo opened 1 month ago
I am unable to reproduce this.
[~/.../os_hardening]: (master *%)
> cat test.yaml
- hosts: localhost
tasks:
- file:
path: /tmp
mode: "1777"
state: directory
:[~/.../os_hardening]: (master *%)
> ansible-playbook test.yaml --diff
PLAY [localhost] ***********************************************************************************************************************************************************************************************************************************************
TASK [Gathering Facts] *****************************************************************************************************************************************************************************************************************************************
ok: [localhost]
TASK [file] ****************************************************************************************************************************************************************************************************************************************************
ok: [localhost]
PLAY RECAP *****************************************************************************************************************************************************************************************************************************************************
localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
basti:[~/.../os_hardening]: (master *%)
> ls -lsah /
0 drwxrwxrwt 18 root root 780 9. Okt 08:52 tmp
os_mnt_tmp_dir_mode: "1777"
to os_mnt_tmp_dir_mode: '01777'
it works?
Description
It appears that 1777 is interpreted as decimal, and gets converted to 03361 octal. The workaround is to override these default vars to '01777'.
Reproduction steps
Current Behavior
Expected Behavior
It should keep the 1777 default setting.
OS / Environment
Provide all relevant information below, e.g. target OS versions, network device firmware, etc.
Ansible Version
Additional information
No response