Playbooks to a new Lilik
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
1.7 KiB

  1. ---
  2. - hosts: vm_hosts
  3. roles:
  4. - role: ssh_server
  5. vars:
  6. management_vlan: 9
  7. virtual_machine_vlan: 13
  8. tasks:
  9. - name: install lxc related packages
  10. apt:
  11. name: "{{ item }}"
  12. state: present
  13. update_cache: yes
  14. cache_valid_time: 3600
  15. with_items:
  16. - lxc
  17. - python
  18. - python-lxc
  19. - name: install common lxc filesystem support
  20. apt:
  21. name: xfsprogs
  22. state: present
  23. - name: install network bridge utilities
  24. apt:
  25. name: "{{ item }}"
  26. state: present
  27. update_cache: yes
  28. cache_valid_time: 3600
  29. with_items:
  30. - bridge-utils
  31. - vlan
  32. notify: restart networking
  33. # We should fix this bug. We really should. It's a bug.
  34. # Bridge-utils requires a complete system reboot to enable the new bridge.
  35. - name: configure network bridge with vlans
  36. template:
  37. src: templates/interfaces.j2
  38. dest: /etc/network/interfaces
  39. notify: restart networking
  40. - name: install utilities
  41. apt:
  42. name: "{{ item }}"
  43. state: present
  44. update_cache: yes
  45. cache_valid_time: 3600
  46. with_items:
  47. - vim
  48. - htop
  49. - name: enable lvm wipe signature
  50. lineinfile:
  51. dest: /etc/lvm/lvm.conf
  52. state: present
  53. line: " wipe_signatures_when_zeroing_new_lvs = 0"
  54. regexp: '^\s*.+wipe_signatures_when_zeroing_new_lvs = '
  55. notify: restart lvm
  56. handlers:
  57. - name: restart networking
  58. service:
  59. name: networking
  60. state: restarted
  61. - name: restart lvm
  62. shell: /etc/init.d/lvm2 reload
  63. - hosts: status
  64. roles:
  65. - role: icinga2-monitoring