Пример запуска: ansible-playbook --connection=local -s /home/pwgen.yml
========================================================
---
- hosts: localhost
become: true
vars:
pkg_name: pwgen
tasks:
- name: Remove "pwgen" package
apt:
name: pwgen
state: absent
- name: Install "pwgen"
apt:
name: "{{ pkg_name }}"
state: latest
========================================================
---
- hosts: localhost
become: true
vars:
pkg_name: pwgen
tasks:
- name: Remove "pwgen" package
apt:
name: pwgen
state: absent
- name: Install "pwgen"
apt:
name: "{{ pkg_name }}"
state: latest