Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

main.yaml 1.3 KiB

4 lat temu
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. ---
  2. - name: Update sources.list
  3. template:
  4. src: etc/apt/sources.list
  5. dest: /etc/apt/sources.list
  6. owner: root
  7. group: root
  8. mode: 0644
  9. - name: Upgrade packages
  10. apt:
  11. upgrade: dist
  12. update_cache: yes
  13. - name: Install packages
  14. apt:
  15. name: "{{ item }}"
  16. loop:
  17. - ubuntu-minimal
  18. - ifupdown
  19. - bridge-utils
  20. - bash-completion
  21. - net-tools
  22. - pciutils
  23. - python3-dev
  24. - python3-pip
  25. - ssh
  26. - usbutils
  27. - unzip
  28. - pkg-config
  29. - iotop
  30. - re2c
  31. - ninja-build
  32. - cmake
  33. - build-essential
  34. - name: Install Ubuntu Server
  35. apt:
  36. name: ubuntu-server
  37. install_recommends: no
  38. - name: Generate locales
  39. locale_gen:
  40. name: en_US.UTF-8
  41. state: present
  42. - name: Enable services
  43. shell: systemctl enable {{ item }}
  44. loop:
  45. - ssh
  46. - systemd-networkd
  47. - systemd-resolved
  48. - name: Create network conf
  49. template:
  50. src: etc/netplan/netcfg.yaml
  51. dest: /etc/netplan/netcfg.yaml
  52. owner: root
  53. group: root
  54. mode: 0644
  55. - name: Create new user
  56. user:
  57. name: "{{ user.name }}"
  58. shell: "{{ user.shell }}"
  59. password: "{{ user.password | password_hash('sha512') }}"
  60. create_home: yes
  61. groups: sudo,sys,video,uucp,lp,input,audio,plugdev
  62. state: present
  63. - name: Ensure default multi-user target
  64. shell: systemctl set-default multi-user.target