Skip to content

systemctl set-environment MYSQLD_OPTS="--skip-grant-tables" #4784

@ziegenberg

Description

@ziegenberg
Summary

I receive an incorrect warning when using ansible.builtin.command to set or unset an environment with systemctl. The warning suggests using ansible.builtin.systemd instead, which does not natively support it.

Issue Type
  • Bug Report
OS / ENVIRONMENT
ansible-lint 25.8.2 using ansible-core:2.19.2 ansible-compat:25.8.1 ruamel-yaml:0.18.15 ruamel-yaml-clib:0.2.12
  • ansible installation method: pip
  • ansible-lint installation method: pip
STEPS TO REPRODUCE
- name: Set MYSQLD_OPTS environment
  ansible.builtin.command:
    cmd: systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"
  changed_when: true
  become: true
Desired Behavior

No linting failures.

Actual Behavior

I receive an error message indicating that I should use the ansible.builtin.systemd module instead of the ansible.builtin.command module.

systemctl used in place of systemd moduleansible-lint[command-instead-of-module]

Metadata

Metadata

Assignees

No one assigned

    Labels

    newTriage required

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions