Skip to content

Commit

Permalink
add systemctl get-default as acceptable command (#4087)
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
  • Loading branch information
konstruktoid committed Apr 3, 2024
1 parent 5934e34 commit 64732fe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions examples/playbooks/rule-command-instead-of-module-pass.yml
Expand Up @@ -22,6 +22,10 @@
ansible.builtin.command: systemctl show-environment
changed_when: false

- name: Get systemd runlevel
ansible.builtin.command: systemctl get-default
changed_when: false

- name: Set systemd runlevel
ansible.builtin.command: systemctl set-default multi-user.target
changed_when: false
Expand Down
1 change: 1 addition & 0 deletions src/ansiblelint/rules/command_instead_of_module.py
Expand Up @@ -72,6 +72,7 @@ class CommandsInsteadOfModulesRule(AnsibleLintRule):
"git": ["branch", "log", "lfs", "rev-parse"],
"systemctl": [
"--version",
"get-default",
"kill",
"set-default",
"set-property",
Expand Down
2 changes: 1 addition & 1 deletion src/ansiblelint/schemas/__store__.json
Expand Up @@ -24,7 +24,7 @@
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/inventory.json"
},
"meta": {
"etag": "e04a9e9c210c666c744dfe9ebf1ca1f4e95e71bd16995514b9c3a56186e66c98",
"etag": "54b5e8c779eb0959619335dcb4d04824bbe0036e5f2bf50b581ea5ed77fd2644",
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/meta.json"
},
"meta-runtime": {
Expand Down

0 comments on commit 64732fe

Please sign in to comment.