playbook.yml 971 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. {% raw %}
  14. - name: Ubuntu Packages
  15. apt: >
  16. pkg={{item}}
  17. state=installed
  18. with_items:
  19. - htop
  20. - iotop
  21. - git
  22. - sysstat
  23. - vim
  24. - tmux
  25. - tree
  26. - tcpdump
  27. - unzip
  28. when: ansible_os_family == "Debian"
  29. - name: CentOS packages
  30. yum: pkg={{item}} state=installed
  31. with_items:
  32. - bind-utils
  33. - sysstat
  34. - tmux
  35. - wget
  36. - git
  37. - vim-enhanced
  38. - iotop
  39. - tree
  40. - tcpdump
  41. when: ansible_distribution == "CentOS"
  42. {% endraw %}
  43. roles:
  44. {% for dep in cookiecutter.dependencies.split(',') %}
  45. - {{ dep.split('/')[-1] }}
  46. {% endfor %}