-
Notifications
You must be signed in to change notification settings - Fork 827
Deprecation warning on Set option hidepid for proc filesystem regarding to_bytes and to_native #936
Copy link
Copy link
Open
Labels
Description
Description
Running the devsec.hardening.os_hardening role with default configuration makes ansible emit some deprecation warnings:
TASK [devsec.hardening.os_hardening : Set option hidepid for proc filesystem] *************************************************************************************************************************************
[WARNING]: Deprecation warnings can be disabled by setting `deprecation_warnings=False` in ansible.cfg.
[DEPRECATION WARNING]: Importing 'to_bytes' from 'ansible.module_utils._text' is deprecated. This feature will be removed from ansible-core version 2.24. Use ansible.module_utils.common.text.converters instead.
[DEPRECATION WARNING]: Importing 'to_native' from 'ansible.module_utils._text' is deprecated. This feature will be removed from ansible-core version 2.24. Use ansible.module_utils.common.text.converters instead.
[DEPRECATION WARNING]: Passing `warnings` to `exit_json` or `fail_json` is deprecated. This feature will be removed from ansible-core version 2.23. Use `AnsibleModule.warn` instead.
changed: [default]
Reproduction steps
- name: my-playbook
hosts: my-hosts
roles:
- role: devsec.hardening.os_hardeningCurrent Behavior
Role is using deprecated functionality which is scheduled to be removed
Expected Behavior
Role uses the suggested replacements before the deprecated functionality is removed from ansible
OS / Environment
Omitted as irrelevant and to reduce noise, but will add when asked.
Ansible Version
ansible [core 2.20.3]
config file = /home/dbx12/projects/server-provisioning/ansible.cfg
configured module search path = ['/home/dbx12/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/dbx12/.local/share/virtualenvs/server-provisioning-ZJ16AGwc/lib/python3.12/site-packages/ansible
ansible collection location = /home/dbx12/.ansible/collections:/usr/share/ansible/collections
executable location = /home/dbx12/.local/share/virtualenvs/server-provisioning-ZJ16AGwc/bin/ansible
python version = 3.12.3 (main, Jan 22 2026, 20:57:42) [GCC 13.3.0] (/home/dbx12/.local/share/virtualenvs/server-provisioning-ZJ16AGwc/bin/python)
jinja version = 3.1.6
pyyaml version = 6.0.3 (with libyaml v0.2.5)Collection Version
collections:
- name: devsec.hardening
version: 10.5.0Additional information
Reactions are currently unavailable