I'm writing my k8s upgrade ansible playbook, and within that I need to do apt-mark unhold kubeadm
. Now, I am trying to avoid using the ansible command
or shell
module to call apt
if possible, but the apt hold/unhold
command does not seem to be supported by neither package
nor apt
modules.
Is it possible to do apt-mark hold
in ansible without command
or shell
?
One of the most valuable features of Ansible is its ability to manage software packages on remote computers with the Ansible apt module. With an apt module, you can manage Ubuntu or Debian-based machines packages, such as updating the package to the latest version or installing multiple packages on a remote node.
If possible, you can destroy the machine using vagrant destroy and create/provision a new one. If it is not possible to destroy the machine and provision a new one then you can add an ansible task to remove the installed package. Using absent as the state will remove the package.
You can use the dpkg_selections
module for this.
- name: Hold kubeadm
dpkg_selections:
name: kubeadm
selection: hold
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With