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.

40 lines
1.2 KiB

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