main.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. ---
  2. - name: Increase Kernel default rx buffersize
  3. sysctl:
  4. name: net.core.rmem_default
  5. value: 26214400
  6. state: present
  7. reload: yes
  8. notify:
  9. - "restart hopglass"
  10. - name: Increase Kernel max rx buffersize
  11. sysctl:
  12. name: net.core.rmem_max
  13. value: 26214400
  14. state: present
  15. reload: yes
  16. notify:
  17. - "restart hopglass"
  18. - name: Increase Kernel max optmem buffersize
  19. sysctl:
  20. name: net.core.optmem_max
  21. value: 81920
  22. state: present
  23. reload: yes
  24. notify:
  25. - "restart hopglass"
  26. - name: Increase max queue len of unhandled rx packets in Kernel
  27. sysctl:
  28. name: net.core.netdev_max_backlog
  29. value: 5000
  30. state: present
  31. reload: yes
  32. notify:
  33. - "restart hopglass"
  34. - name: Add nodejs repo keys
  35. apt_key:
  36. id: 1655A0AB68576280
  37. url: "https://deb.nodesource.com/gpgkey/nodesource.gpg.key"
  38. state: present
  39. - name: Add repo for nodejs
  40. apt_repository:
  41. repo: "{{ item }}"
  42. state: present
  43. update_cache: yes
  44. with_items:
  45. - "deb https://deb.nodesource.com/node_6.x {{ ansible_distribution_release }} main"
  46. - "deb-src https://deb.nodesource.com/node_6.x {{ ansible_distribution_release }} main"
  47. - name: Install nodejs
  48. apt:
  49. pkg: nodejs
  50. state: installed
  51. - name: Create HopGlass-server directory if not existent
  52. file:
  53. path: /opt/hopglass
  54. state: directory
  55. - name: Create HopGlass User
  56. user:
  57. name: hopglass
  58. system: yes
  59. createhome: yes
  60. home: /opt/hopglass
  61. - name: Clone HopGlass Server Repo
  62. git: repo=https://github.com/hopglass/hopglass-server.git dest=/opt/hopglass/server force=yes
  63. notify:
  64. - "restart hopglass"
  65. register: hopglass_server_git_clone
  66. - name: Adjust permissions
  67. file:
  68. path: /opt/hopglass
  69. owner: hopglass
  70. group: hopglass
  71. recurse: yes
  72. when: hopglass_server_git_clone.changed
  73. - name: install dependencies
  74. shell: npm install
  75. args:
  76. chdir: /opt/hopglass/server
  77. when: hopglass_server_git_clone.changed
  78. - name: Create HopGlass-server Config directory if not existent
  79. file: path=/etc/hopglass-server/default state=directory
  80. - name: Setup systemd service
  81. copy:
  82. src: /opt/hopglass/server/hopglass-server@.service
  83. dest: /lib/systemd/system/
  84. remote_src: True
  85. - name: Adjust permissions of /etc/hopglass-server
  86. file:
  87. path: /etc/hopglass-server
  88. owner: hopglass
  89. group: hopglass
  90. recurse: yes
  91. - name: Copy config.json
  92. template:
  93. src: config.json.j2
  94. dest: /etc/hopglass-server/default/config.json
  95. owner: hopglass
  96. group: hopglass
  97. mode: 0644
  98. notify:
  99. - "restart hopglass"
  100. - name: install hopglass server service hopglass-server
  101. service: name=hopglass-server@default enabled=yes