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.

63 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 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. notify: restart networking
  26. - name: install vlan module
  27. apt:
  28. name: vlan
  29. # We should fix this bug. We really should. It's a bug.
  30. # Bridge-utils requires a complete system reboot to enable the new bridge.
  31. - name: configure bridge
  32. template:
  33. src: templates/interfaces.j2
  34. dest: /etc/network/interfaces
  35. notify: restart networking
  36. - name: install utilities
  37. apt:
  38. name: "{{ item }}"
  39. state: present
  40. update_cache: yes
  41. cache_valid_time: 3600
  42. with_items:
  43. - vim
  44. - htop
  45. - name: add ca pub key
  46. copy:
  47. content: "ssh-rsa {{ user_ca_key }}"
  48. dest: /etc/ssh/user_ca.pub
  49. - name: trust ca pub key
  50. lineinfile:
  51. dest: /etc/ssh/sshd_config
  52. state: present
  53. line: "TrustedUserCAKeys /etc/ssh/user_ca.pub"
  54. notify: restart sshd
  55. handlers:
  56. - name: restart networking
  57. service:
  58. name: networking
  59. state: reloaded
  60. - name: restart sshd
  61. service:
  62. name: networking
  63. state: reloaded