Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 1.21 KB

packages-ex1.rst

File metadata and controls

56 lines (40 loc) · 1.21 KB

Example 1: Install packages automatically

If enabled lp_packages_auto=true packages in the dynamically created list my_packages_auto will be installed. This includes packages listed in the variables lp_<name>_packages where lp_<name>_install is true

Create playbook

shell> cat lp.yml
- hosts: test_01
  become: true
  roles:
    - vbotka.linux_postinstall

Show variables

Display the variables:

shell> ansible-playbook lp.yml -t lp_packages_debug -e lp_packages_debug=True

and take a look at the list my_packages_auto. For example,

my_packages_auto:
  - [autofs]
  - [chrony]
  - [debsums]
  - [gnupg, gpg, gpg-agent]
  - [texlive]
  - [logrotate]
  - [pass]
  - [postfix]
  - [resolvconf]
  - [smartmontools]
  - []
  - [tlp, tlp-rdw]
  - [wpasupplicant, wpagui, net-tools, ifupdown, wireless-tools]
  - [wpasupplicant]
  - [zfsutils-linux]

Install packages listed in my_packages_auto

examples/packages-ex1-auto.yaml.example