Apply Security patches using zypper module
Solution 1:
Some Ansible modules, including zypper, have parameters that allow arbitrary extra options. To go beyond the documented examples, get creative by adding what you already know works without Ansible.
zypper module doc has an example of applying patches. Which just leaves filtering by category security:
- name: Apply security patches
zypper:
name: '*'
state: latest
type: patch
extra_args: '--category=security'
name: '*'
is an Ansible convention for all packages. Read the module code to see that is is implmented as zypper patch
without a package argument.