-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitea.yaml
66 lines (62 loc) · 1.8 KB
/
gitea.yaml
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
---
# Written by karakara104
- name: "Import variables"
hosts: gitea
tasks:
- include_vars: secrets.yml
- debug: msg="Hello, {{ gitea_user_username }}!"
tags:
- always
- name: "Install gitea"
hosts: gitea
roles:
- {role: gitea, tags: gitea}
vars:
gitea_fqdn: 'git.donk.lan'
gitea_root_url: "http://{{ gitea_fqdn }}:3000"
gitea_protocol: http
gitea_ssh_listen: '0.0.0.0' # will need to provide IP for admin VM
gitea_start_ssh: true
tags:
- install
- configure
# create autosigned cert : gitea cert --host git.donk.lan
# move key and cert to home : {{ gitea_custom }}
- name: "create gitea user"
hosts: gitea
tasks:
- name: "Create user"
shell: "gitea admin user create --username {{ gitea_user_username }} --password {{ gitea_user_password }} --email [email protected] -c {{ gitea_configuration_path }}/gitea.ini"
become: yes # allow privilege escalation
become_user: gitea
vars:
ansible_shell_allow_world_readable_temp: true
gitea_configuration_path: "/etc/gitea"
tags:
- postinstall
- createuser
- name: "clone repo"
hosts: gitea
tasks:
- name: "use gitea API"
ansible.builtin.uri:
url: http://git.donk.lan:3000/api/v1/repos/migrate
method: POST
user: "{{ gitea_user_username }}"
password: "{{ gitea_user_password }}"
force_basic_auth: yes
body_format: json
body:
auth_password: "{{ gitea_user_password }}"
auth_token: "{{ github_token }}"
auth_username: "{{ gitea_user_username }}"
clone_addr: "https://github.com/donkesport/donk-lan"
repo_name: "donk-lan"
repo_owner: "{{ gitea_user_username }}"
mirror: true
private: false
status_code: 201
tags:
- postinstall
- clonerepo
...