main.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. ---
  2. - name: create tbb-nightly user
  3. user:
  4. name: "{{ nightly_build_user }}"
  5. comment: "Tor Browser Nightly Builds"
  6. groups: tbb-build
  7. createhome: yes
  8. home: "/home/{{ nightly_build_user }}"
  9. - name: clone tor browser testsuite
  10. become: yes
  11. become_user: "{{ nightly_build_user }}"
  12. git:
  13. repo: "{{ testsuite_git_url }}"
  14. dest: "{{ testsuite_dir }}"
  15. version: "{{ testsuite_git_commit }}"
  16. - name: install testsuite dependencies
  17. command: "{{ testsuite_dir }}/install-deps"
  18. - name: add testsuite config
  19. template:
  20. src: testsuite-config
  21. dest: "{{ testsuite_dir }}/config/tbb-nightly"
  22. mode: 0644
  23. owner: "{{ nightly_build_user }}"
  24. - name: create rbm-config directory
  25. file:
  26. path: '{{ testsuite_dir }}/rbm-config/'
  27. state: directory
  28. owner: '{{ nightly_build_user }}'
  29. mode: 0755
  30. - name: add rbm config
  31. template:
  32. src: rbm.local.conf
  33. dest: "{{ testsuite_dir }}/rbm-config/tbb-nightly.rbm.local.conf"
  34. mode: 0644
  35. owner: "{{ nightly_build_user }}"
  36. - name: prune-old-builds
  37. copy:
  38. src: prune-old-builds
  39. dest: "/home/{{ nightly_build_user }}/prune-old-builds"
  40. mode: 0755
  41. owner: "{{ nightly_build_user }}"
  42. - name: add start-tbb-nightly script
  43. template:
  44. src: start-tbb-nightly
  45. dest: "/home/{{ nightly_build_user }}/start-tbb-nightly"
  46. mode: 0755
  47. owner: "{{ nightly_build_user }}"
  48. - name: add cron to start nighly build
  49. cron:
  50. name: tbb-nightly-build
  51. user: "{{ nightly_build_user }}"
  52. hour: "{{ nightly_build_cron_hour }}"
  53. minute: "{{ nightly_build_cron_minute }}"
  54. job: "/home/{{ nightly_build_user }}/start-tbb-nightly"
  55. - name: create wwwdir
  56. file:
  57. path: '{{ nightly_build_wwwdir }}'
  58. state: directory
  59. owner: '{{ nightly_build_user }}'
  60. mode: 0755
  61. - name: add index page
  62. template:
  63. src: www-index.html
  64. dest: "{{ nightly_build_wwwdir }}/index.html"
  65. mode: 0644
  66. owner: "{{ nightly_build_user }}"
  67. - name: create tbb-nightly-build.auth_basic_user_file
  68. template:
  69. src: tbb-nightly-build.auth_basic_user_file
  70. dest: /etc/nginx/tbb-nightly-build.auth_basic_user_file
  71. mode: 0644
  72. owner: root
  73. when: nightly_build_nginx_auth_basic_enable
  74. - name: install nginx
  75. apt:
  76. name: nginx
  77. state: present
  78. when: nightly_build_nginx_enable
  79. - name: add nginx config
  80. template:
  81. src: nginx.conf
  82. dest: /etc/nginx/sites-enabled/tbb-nightly-build
  83. mode: 0644
  84. notify:
  85. - restart nginx
  86. when: nightly_build_nginx_enable