tasks_install_packages.yml 588 B

123456789101112131415161718192021
  1. ---
  2. - name: "00: System upgrade"
  3. ansible.builtin.apt:
  4. upgrade: "dist"
  5. update_cache: "yes"
  6. - name: "10: Determine needed system packages"
  7. ansible.builtin.set_fact:
  8. packages: "{{ lookup('ansible.builtin.file', '{{ item }}') | trim }}"
  9. with_first_found:
  10. - "files/{{ machine_type }}/{{ machine_subtype }}/packages.txt"
  11. - "files/{{ machine_type }}/packages.txt"
  12. - "files/packages.txt"
  13. - name: "20: Install packages"
  14. ansible.builtin.package:
  15. name: "{{ _package_name }}"
  16. loop: "{{ packages.splitlines() }}"
  17. loop_control:
  18. loop_var: "_package_name"