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.

57 lines
1.5 KiB

  1. ---
  2. - hosts: vm_hosts
  3. tasks:
  4. - name: install lxc related packages
  5. apt:
  6. name: "{{ item }}"
  7. state: present
  8. update_cache: yes
  9. cache_valid_time: 3600
  10. with_items:
  11. - lxc
  12. - python
  13. - python-lxc
  14. - name: install bridge utilities
  15. apt:
  16. name: "{{ item }}"
  17. state: present
  18. update_cache: yes
  19. cache_valid_time: 3600
  20. with_items:
  21. - bridge-utils
  22. notify: restart networking
  23. # We should fix this bug. We really should. It's a bug.
  24. # Bridge-utils requires a complete system reboot to enable the new bridge.
  25. - name: configure bridge
  26. template:
  27. src: templates/interfaces.j2
  28. dest: /etc/network/interfaces
  29. notify: restart networking
  30. - name: install utilities
  31. apt:
  32. name: "{{ item }}"
  33. state: present
  34. update_cache: yes
  35. cache_valid_time: 3600
  36. with_items:
  37. - vim
  38. - htop
  39. - name: add ca pub key
  40. copy:
  41. content: "ssh-rsa {{ user_ca_key }}"
  42. dest: /etc/ssh/user_ca.pub
  43. - name: trust ca pub key
  44. lineinfile:
  45. dest: /etc/ssh/sshd_config
  46. state: present
  47. line: "TrustedUserCAKeys /etc/ssh/user_ca.pub"
  48. notify: restart sshd
  49. handlers:
  50. - name: restart networking
  51. service:
  52. name: networking
  53. state: reloaded
  54. - name: restart sshd
  55. service:
  56. name: networking
  57. state: reloaded