ansible.builtin.apt – Manages apt-packages — Ansible ...
docs.ansible.com › ansible › latestDec 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 ...
TΩИΨ: Ansible - How to Install or Remove Multiple Packages
www.lixu.ca › 2017 › 04Apr 30, 2017 · An exmple of installing or removing multiple package using with_items. main.yml: - hosts: docker-host tasks: - name: Remove old versions of Docker yum: pkg= { {item}} state=absent with_items: - docker - docker-common - container-selinux - docker-selinux - docker-engine. Then from the command line: $ ansible-playbook -s main.yml PLAY [dashboard-dev] *********************************************************** TASK [setup] ...