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.

main.yaml 2.0KB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ---
  2. - name: pip3 packages for buildbot-worker
  3. pip:
  4. name:
  5. - buildbot-worker
  6. executable: pip3
  7. - name: buildbot-worker var directory
  8. file:
  9. path: /var/lib/buildbot-worker
  10. state: directory
  11. - name: buildbot-worker group
  12. group:
  13. name: "{{ buildbot_worker_group }}"
  14. - name: buildbot-worker user
  15. user:
  16. name: "{{ buildbot_worker_user }}"
  17. group: "{{ buildbot_worker_group }}"
  18. home: "{{ buildbot_worker_home_directory }}"
  19. shell: /usr/bin/fish
  20. password_lock: true
  21. - name: buildbot-worker home directory
  22. file:
  23. path: "{{ buildbot_worker_home_directory }}"
  24. owner: "{{ buildbot_worker_user }}"
  25. group: "{{ buildbot_worker_group }}"
  26. state: directory
  27. mode: u=rwx,g=rx,o=
  28. # source of unit file from https://github.com/buildbot/buildbot-contrib/blob/master/worker/contrib/systemd/buildbot-worker%40.service
  29. - name: buildbot-worker systemd service unit
  30. copy:
  31. src: systemd/buildbot-worker@.service
  32. dest: /etc/systemd/system/buildbot-worker@.service
  33. notify:
  34. - systemd daemon reload
  35. - restart buildbot-worker service
  36. - name: initiate buildbot-worker
  37. command: buildbot-worker create-worker worker localhost:9989 "{{buildbot_worker_name}}" "{{buildbot_worker_password}}"
  38. become: true
  39. become_user: "{{buildbot_worker_user}}"
  40. args:
  41. chdir: "{{buildbot_worker_home_directory}}"
  42. creates: /var/lib/buildbot-worker/{{buildbot_worker_name}}/worker
  43. notify: restart buildbot-worker service
  44. - name: buildbot-worker host info
  45. copy:
  46. content: "{{buildbot_worker_host_info}}"
  47. dest: /var/lib/buildbot-worker/{{buildbot_worker_name}}/worker/info/host
  48. owner: "{{ buildbot_worker_user }}"
  49. group: "{{ buildbot_worker_group }}"
  50. notify: restart buildbot-worker service
  51. - name: buildbot-worker admin info
  52. copy:
  53. content: "{{buildbot_worker_admin_info}}"
  54. dest: /var/lib/buildbot-worker/{{buildbot_worker_name}}/worker/info/admin
  55. owner: "{{ buildbot_worker_user }}"
  56. group: "{{ buildbot_worker_group }}"
  57. notify: restart buildbot-worker service