--- - name: Updating package cache shell: yum repolist - name: Installing versionlock yum-plugin yum: name: yum-plugin-versionlock state: present - name: Checking if already locked shell: yum versionlock list | grep -q nethserver-release && echo 'Locked' || true register: chk_locked_nethrelease changed_when: "'Locked' not in chk_locked_nethrelease.stdout" - name: Locking nethserver-release version shell: yum versionlock add nethserver-release when: chk_locked_nethrelease is changed