ansible-collection-hardening icon indicating copy to clipboard operation
ansible-collection-hardening copied to clipboard

devsec.hardening.mysql_hardening - Operation not supported on ubuntu 22.04

Open markuman opened this issue 1 year ago • 5 comments

Description

When applying mysql_hardening role on a ubuntu 22.04 host with mariadb 10.6.11 I got

TASK [devsec.hardening.mysql_hardening : Check include-dir directive is present in my.cnf] **********************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: Exception: Error while setting attributes: /etc/mysql/my.cnf.48637.2023-02-06@20:21:25~: Operation not supported
fatal: [ansible2.osuv.de]: FAILED! => {"changed": false, "details": "Error while setting attributes: /etc/mysql/my.cnf.48637.2023-02-06@20:21:25~: Operation not supported\n", "gid": 119, "group": "mysql", "mode": "0640", "msg": "chattr failed", "owner": "root", "path": "/etc/mysql/my.cnf.48637.2023-02-06@20:21:25~", "size": 1126, "state": "file", "uid": 0}

Reproduction steps

- name: apply devsec.hardening.mysql_hardening role
  ansible.builtin.include_role:
    name: devsec.hardening.mysql_hardening
  vars:
    mysql_root_password: "{{ mariadb_root_password }}"

Current Behavior

TASK [devsec.hardening.mysql_hardening : Check include-dir directive is present in my.cnf] **********************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: Exception: Error while setting attributes: /etc/mysql/my.cnf.48637.2023-02-06@20:21:25~: Operation not supported
fatal: [ansible2.osuv.de]: FAILED! => {"changed": false, "details": "Error while setting attributes: /etc/mysql/my.cnf.48637.2023-02-06@20:21:25~: Operation not supported\n", "gid": 119, "group": "mysql", "mode": "0640", "msg": "chattr failed", "owner": "root", "path": "/etc/mysql/my.cnf.48637.2023-02-06@20:21:25~", "size": 1126, "state": "file", "uid": 0}

Expected Behavior

no error

OS / Environment

Ubuntu 22.04

Ansible Version

ansible [core 2.13.5]
  config file = None
  configured module search path = ['/home/m/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/m/.local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/m/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/m/.local/bin/ansible
  python version = 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0]
  jinja version = 3.1.2
  libyaml = False

Collection Version

devsec.hardening               8.6.0

Additional information

markuman avatar Feb 06 '23 20:02 markuman