0

Do we have any options to apply security patches only with Zypper ansible module for suse linux server. We don't want to use shell or command module and incorporate the command.

Equivalent command shell: zypper patch --category=security

  • Did you check the [docs](https://docs.ansible.com/ansible/latest/collections/community/general/zypper_module.html)? – Michael Hampton Aug 19 '21 at 13:45
  • Yes already, there is no options available to perform security patching in Ansible-doc, but I'm sure there should be some other ways to perform the same which I'm not able to explore as of now. – pugazhendhi Aug 19 '21 at 22:41

1 Answers1

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.

John Mahowald
  • 30,009
  • 1
  • 17
  • 32