thegeeklab / ansible-later

Another best practice scanner for Ansible roles and playbooks
https://ansible-later.geekdocs.de
MIT License
110 stars 11 forks source link

ANS108 - systemctl command used in place of systemd module #838

Open bataliero opened 1 month ago

bataliero commented 1 month ago

Hi

I those 2 examples below I see following error: ERROR: [ANS108] rule 'Commands should not be used in place of modules' not met

- name: Start graphical target 
  ansible.builtin.command:
    cmd: "systemctl isolate graphical.target"
- name: Set default system target to graphical 
  ansible.builtin.command:
    cmd: "systemctl set-default graphical.target"

However I do not see any module which could be used in place of "ansible.builtin.command"

Is there a workaround to suppress ANS108 only for those 2 tasks e.g, using # noqa: ANS108 inline?

Thanks!

xoxys commented 1 month ago

Hi, sorry, no this is not possible. You might want to give ansible-lint a try, as I plan to discontinue ansible-later soon.