Ansible roles by Evolix
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.
 
 
 
 
 
 

41 lines
908 B

  1. ---
  2. - name: Install lxc tools
  3. apt:
  4. name:
  5. - lxc
  6. - debootstrap
  7. - xz-utils
  8. - python-lxc
  9. - name: Install additional packages on Buster
  10. apt:
  11. name:
  12. - apparmor
  13. - lxc-templates
  14. when: ansible_distribution_major_version is version('10', '>=')
  15. - name: Copy LXC default containers configuration
  16. template:
  17. src: default.conf
  18. dest: /etc/lxc/
  19. - name: Check if root has subuids
  20. command: grep '^root:100000:10000$' /etc/subuid
  21. failed_when: false
  22. changed_when: false
  23. register: root_subuids
  24. when: lxc_unprivilegied_containers
  25. - name: Add subuid and subgid ranges to root
  26. command: usermod -v 100000-199999 -w 100000-109999 root
  27. when:
  28. - lxc_unprivilegied_containers
  29. - root_subuids.rc
  30. - name: Create containers
  31. include: create-container.yml
  32. vars:
  33. name: "{{ item.name }}"
  34. release: "{{ item.release }}"
  35. loop: "{{ lxc_containers }}"