Skip to content

Check use of Check mode. #1

Description

@centiqchris

The default value of el_patching_check_mode is false.

This is used in your task here for example

- name: Update all packages
  ansible.builtin.dnf:
    name: "*"
    state: latest
    exclude: "{{ el_patching_exclude_packages | default(omit) }}"
  check_mode: "{{ el_patching_check_mode }}"
  when: el_patching_method == "all"

I don't believe this has the result that you intended.

By setting check_mode to false, you cause the task to execute irrespective of whether --check is specified on the play - it does not mean that the task will not execute in check mode.

https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_checkmode.html#enforcing-or-preventing-check-mode-on-tasks

What this will do is ensure that you will update your servers when --check is specified - and I don't think this is what you wanted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions