Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os_env_umask has no effect #344

Closed
sprat opened this issue Dec 14, 2020 · 2 comments · Fixed by #351
Closed

os_env_umask has no effect #344

sprat opened this issue Dec 14, 2020 · 2 comments · Fixed by #351

Comments

@sprat
Copy link
Contributor

sprat commented Dec 14, 2020

Describe the bug

The os_env_umask variable described in the README has no effect on the role execution

Expected behavior

The variable should be taken into account

Actual behavior

The variable is not taken into account: no change when the variable is set between 2 executions

Example Playbook

---
- name: NAS
  hosts: nas
  become: true
  tasks:
    - import_role:
        name: devsec.hardening.os_hardening
      vars:
        os_env_umask: '022'

OS / Environment

Ubuntu 20.04
Linux nas-test 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Ansible Version

ansible 2.10.3
  config file = /home/sylvain/Dev/ansible-nas/ansible.cfg
  configured module search path = ['/home/sylvain/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/sylvain/.virtualenvs/ansible-nas/lib/python3.8/site-packages/ansible
  executable location = /home/sylvain/.virtualenvs/ansible-nas/bin/ansible
  python version = 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0]

Role Version

devsec.hardening:7.0.0

Additional context

I think it's a variable priority issue

@sprat sprat changed the title `os_env_umask os_env_umask has no effect Dec 14, 2020
@rndmh3ro
Copy link
Member

I think it's a variable priority issue

Yes, that's the same problem as described here: #177

We should probably do something about it..

@sprat
Copy link
Contributor Author

sprat commented Dec 14, 2020

Sorry for the duplicate.

I would probably solve the problem by defining a os_env_umask_default variable per platform, and using {{ os_env_umask | default(os_env_umask_default) }} in the templates

divialth pushed a commit to divialth/ansible-collection-hardening that referenced this issue Aug 3, 2022
Signed-off-by: Sylvain Prat <sylvain.prat@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants