summaryrefslogtreecommitdiff
path: root/roles/gitea/main.yml
blob: dc4ae05cc9e7b6d70e570a3a2e4746fe4274d927 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
- name: Container Setup

  vars:
    lxc_base: ansible-alpine3.11
    lxc_name: gitea

  import_playbook: ../common/tasks/lxc.yml

- name: Install Gitea Service
  hosts: gitea

  vars_files:
    - ../variables.yml

  tasks:

  - name: Ensuring user exists
    user:
      name: "{{ gitea_user }}"
      state: present

  - name: Installing the required dependencies
    apk:
      state: present
      update_cache: yes
      name:
        - gitea

  - name: Replacing with repository binary
    get_url:
      url: "{{ gitea_url }}"
      dest: /usr/bin/gitea
      checksum: "sha256:{{ gitea_checksum }}"

  - name: Ensuring service has been started and enabled
    service:
      name: gitea
      state: restarted
      enabled: yes

  - name: Waiting for application to become active
    wait_for:
      port: 3000

  - name: Testing if explore page exists
    uri:
      url: http://0.0.0.0:3000/explore/repos
      return_content: yes