From 0b894cdd59ac9d7ee6dbccc5e1deebd68f2feb55 Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Wed, 1 Jan 2020 17:50:56 +0000 Subject: [PATCH] working setup --- files/systemd/buildbot@.service | 24 ++++++++++++++++++ tasks/main.yaml | 44 +++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 files/systemd/buildbot@.service diff --git a/files/systemd/buildbot@.service b/files/systemd/buildbot@.service new file mode 100644 index 0000000..b4e793c --- /dev/null +++ b/files/systemd/buildbot@.service @@ -0,0 +1,24 @@ +# This template file assumes the buildbot master lives in a subdirectory of +# /var/lib/buildbot +# Usage: +# cd /var/lib/buildbot +# buildbot create-master [directory] +# systemctl enable --now buildbot@[directory].service +[Unit] +Description=Buildbot Master +After=network.target + +[Service] +User=buildbot +Group=buildbot +WorkingDirectory=/var/lib/buildbot +ExecStart=/usr/bin/buildbot --verbose start --nodaemon %I +ExecReload=/bin/kill -HUP $MAINPID +Restart=always +ProtectSystem=full +ProtectHome=yes +PrivateDevices=yes +PrivateTmp=yes + +[Install] +WantedBy=multi-user.target diff --git a/tasks/main.yaml b/tasks/main.yaml index ed97d53..62d4c7a 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -1 +1,45 @@ --- + +- name: debian package requirements for buildbot + apt: + pkg: + - python3-pip + - fish + - git + +- name: install buildbot + pip: + name: buildbot[bundle] + executable: pip3 + +- name: install gitea integration for buildbot + pip: + name: buildbot_gitea + executable: pip3 + +- name: buildbot system group + group: + name: buildbot + system: yes + +- name: buildbot system user + user: + name: buildbot + group: buildbot + system: yes + home: /var/lib/buildbot + shell: /usr/bin/fish + +- name: buildbot var directory + file: + path: /var/lib/buildbot + state: directory + owner: buildbot + group: buildbot + mode: 0700 + +# source of unit file from https://github.com/buildbot/buildbot-contrib/blob/master/master/contrib/systemd/buildbot%40.service +- name: buildbot systemd service unit + copy: + src: systemd/buildbot@.service + dest: /etc/systemd/system/buildbot@.service