Skip to content

Commit

Permalink
Allow 'use' parameter with service module (args) (#3147)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Mar 7, 2023
1 parent 8eb9584 commit cef6c1e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions examples/playbooks/rule-args-module-pass.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,12 @@
- "ls -lah > /dev/stderr"
chdir: /root
register: result

- name: "Bug 3138"
become: true
ansible.builtin.service:
name: "jenkins"
state: started
# 'use' is dropped by preprocessing ...
use: "{{ ansible_service_mgr }}"
changed_when: false
3 changes: 2 additions & 1 deletion src/ansiblelint/rules/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
# https://github.com/ansible/ansible-lint/issues/3110
"ansible.builtin.copy": ["decrypt"],
# https://github.com/ansible/ansible-lint/issues/2824#issuecomment-1354337466
"ansible.builtin.service": ["daemon_reload"],
# https://github.com/ansible/ansible-lint/issues/3138
"ansible.builtin.service": ["daemon_reload", "use"],
# Avoid: Unsupported parameters for (basic.py) module: cmd. Supported parameters include: _raw_params, _uses_shell, argv, chdir, creates, executable, removes, stdin, stdin_add_newline, strip_empty_ends.
"ansible.builtin.command": ["cmd"],
}
Expand Down

0 comments on commit cef6c1e

Please sign in to comment.