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.

65 lines
1.6 KiB

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