Skip to content

Latest commit

 

History

History
47 lines (29 loc) · 900 Bytes

packages-ex2.rst

File metadata and controls

47 lines (29 loc) · 900 Bytes

Example 2: Install packages

Install packages listed in lp_packages_install

Create playbook

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

Create variables

Create the file host_vars/test_01/lp-packages.yml and declare the list of packages lp_packages_install

shell> cat host_vars/test_01/lp-packages.yml
lp_packages_install:
  - ansible
  - ansible-lint
  - ara-client

Show variables

Display the variables:

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

Install packages listed in lp_packages_install

examples/packages-ex2-install.yaml.example