UniFi Network Controller VM image
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.

68 lines
1.5 KiB

  1. - hosts: default
  2. debugger: on_failed
  3. vars:
  4. unifi_software_url: https://dl.ubnt.com/unifi/5.10.21/UniFi.unix.zip
  5. tasks:
  6. - replace:
  7. path: /etc/apk/repositories
  8. regexp: '^#(.*v\d+.\d+/community.*)$'
  9. replace: '\1'
  10. - apk:
  11. name: openjdk8-jre
  12. state: present
  13. update_cache: yes
  14. - apk:
  15. name: '{{item}}'
  16. state: present
  17. loop:
  18. - shadow
  19. - mongodb
  20. - s6
  21. - unzip
  22. - user:
  23. name: unifi
  24. home: /srv/unifi
  25. - get_url:
  26. url: '{{unifi_software_url}}'
  27. dest: /tmp/UniFi.unix.zip
  28. - command: unzip /tmp/UniFi.unix.zip
  29. args:
  30. chdir: /tmp
  31. warn: false
  32. - shell: mv /tmp/UniFi/* /srv/unifi
  33. - command: rm /srv/unifi/bin/mongod
  34. - file:
  35. path: /srv/unifi
  36. owner: unifi
  37. mode: o-rwx
  38. recurse: yes
  39. - file:
  40. dest: /srv/unifi/bin/mongod
  41. src: /usr/bin/mongod
  42. state: link
  43. - file:
  44. path: /etc/unifi/log
  45. state: directory
  46. - template:
  47. src: templates/unifi/run
  48. dest: /etc/unifi/run
  49. mode: 755
  50. - template:
  51. src: templates/unifi/log/run
  52. dest: /etc/unifi/log/run
  53. mode: 755
  54. - user:
  55. name: log
  56. home: /var/log
  57. - file:
  58. path: /var/log/unifi
  59. state: directory
  60. owner: log
  61. mode: 750
  62. - template:
  63. src: templates/init.d/unifi
  64. dest: /etc/init.d/unifi
  65. mode: 755
  66. - service:
  67. name: unifi
  68. state: started
  69. enabled: yes