playbook.yml 924 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ---
  2. - hosts: all
  3. become: yes
  4. become_user: root
  5. become_method: sudo
  6. gather_facts: yes
  7. vars_files:
  8. - vars/main.yml
  9. pre_tasks:
  10. - name: Update Apt Cache
  11. apt: update_cache=yes cache_valid_time=86400
  12. when: ansible_os_family == "Debian"
  13. - name: Ubuntu Packages
  14. apt: >
  15. pkg={{item}}
  16. state=installed
  17. with_items:
  18. - htop
  19. - iotop
  20. - git
  21. - sysstat
  22. - vim
  23. - tmux
  24. - tree
  25. - tcpdump
  26. - unzip
  27. when: ansible_os_family == "Debian"
  28. - name: CentOS packages
  29. yum: pkg={{item}} state=installed
  30. with_items:
  31. - bind-utils
  32. - sysstat
  33. - tmux
  34. - wget
  35. - git
  36. - vim-enhanced
  37. - iotop
  38. - tree
  39. - tcpdump
  40. when: ansible_distribution == "CentOS"
  41. roles:
  42. {% for dep in cookiecutter.dependencies.split(',') -%}
  43. - {{ dep }}
  44. {% endfor -%}