aboutsummaryrefslogtreecommitdiff
path: root/roles/woodpecker/tasks/server.yaml
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2024-04-16 19:45:09 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2024-04-16 19:45:09 +0200
commitef56d42b7e06061db5afbf9011e76d308c936080 (patch)
tree1f61386c53ecb311e7e79f619aa59a42f146c898 /roles/woodpecker/tasks/server.yaml
parent607d91ed23eaa9d1fb9cc9e1279537b8805e236e (diff)
downloadansible_collection-ef56d42b7e06061db5afbf9011e76d308c936080.tar.gz
woodpecker agent and server
Diffstat (limited to 'roles/woodpecker/tasks/server.yaml')
-rw-r--r--roles/woodpecker/tasks/server.yaml43
1 files changed, 43 insertions, 0 deletions
diff --git a/roles/woodpecker/tasks/server.yaml b/roles/woodpecker/tasks/server.yaml
new file mode 100644
index 0000000..57b9edf
--- /dev/null
+++ b/roles/woodpecker/tasks/server.yaml
@@ -0,0 +1,43 @@
+---
+- name: Create User
+ user:
+ name: woodpecker
+ home: /var/lib/woodpecker
+ shell: /bin/bash
+ system: true
+ state: present
+ become: true
+
+- name: Download DEB
+ get_url:
+ url: 'https://github.com/woodpecker-ci/woodpecker/releases/download/v{{ woodpecker_ver }}/woodpecker-server_{{ woodpecker_ver }}_amd64.deb'
+ dest: /var/lib/woodpecker/server.deb
+ become: true
+
+- name: Install DEB
+ apt:
+ deb: /var/lib/woodpecker/server.deb
+ become: true
+ notify:
+ - Handle systemd
+
+- name: Install woodpecker unit file
+ copy:
+ src: woodpecker-server.service
+ dest: /etc/systemd/system/woodpecker-server.service
+ become: true
+ notify:
+ - Handle systemd
+
+- name: Create config file
+ template:
+ src: woodpecker.j2
+ dest: /etc/woodpecker_server
+ owner: root
+ group: woodpecker
+ mode: '640'
+ become: true
+ loop:
+ - '{{ woodpecker_server }}'
+ notify:
+ - Handle systemd