amazon ec2 - Remove package ansible playbook - Stack Overflow
stackoverflow.com › questions › 29914253Apr 28, 2015 · Ansible cannot automatically remove packages when you remove them from you playbook. Ansible is stateless. This means it will not keep track of what it does and therefore does not know what it did in recent runs or if your playbook/role has been modified. Ansible will only do what you explicitly describe in the playbook/role. So you have to write a task to remove it. You can easily do this with the apt module.
ansible.builtin.apt – Manages apt-packages — Ansible ...
docs.ansible.com › ansible › builtinDec 21, 2021 · -name: Install apache httpd (state=present is optional) apt: name: apache2 state: present-name: Update repositories cache and install "foo" package apt: name: foo update_cache: yes-name: Remove "foo" package apt: name: foo state: absent-name: Install the package "foo" apt: name: foo-name: Install a list of packages apt: pkg:-foo-foo-tools-name: Install the version '1.00' of package "foo" apt: name: foo=1.00-name: Update the repository cache and update package "nginx" to latest version using ...
apt - Manages apt-packages — Ansible Documentation
docs.ansible.com › ansible › 2Dec 01, 2020 · -name: Update repositories cache and install "foo" package apt: name: foo update_cache: yes-name: Remove "foo" package apt: name: foo state: absent-name: Install the package "foo" apt: name: foo state: present-name: Install the version '1.00' of package "foo" apt: name: foo=1.00 state: present-name: Update the repository cache and update package "nginx" to latest version using default release squeeze-backport apt: name: nginx state: latest default_release: squeeze-backports update_cache: yes ...
How to use the Ansible apt Module to Manage Linux Packages
https://adamtheautomator.com/ans22.09.2021 · Ansible is a popular automation platform allowing you to manage thousands of nodes at one time. 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 …