feat: rewrite harbor deployment

This commit is contained in:
2023-12-29 13:02:54 +00:00
parent b3094727e5
commit ebd91306cd
15 changed files with 372 additions and 445 deletions

View File

@@ -0,0 +1,46 @@
- name: Install Docker prerequisites
apt:
state: present
pkg:
- docker.io
- docker-compose
- set_fact:
harbor_version: v2.10.0
harbor_file: harbor-online-installer-{{ harbor_version }}.tgz
- name: Create /data/ dir
file:
path: /data/
state: directory
- name: Download release
get_url:
url: https://github.com/goharbor/harbor/releases/download/{{ harbor_version }}/{{ harbor_file }}
dest: /opt/{{ harbor_file }}
- name: Extract release
unarchive:
remote_src: true
src: /opt/harbor-online-installer-v2.10.0.tgz
dest: /opt/harbor/
- name: Copy harbor config
template:
src: harbor.config.yaml
dest: /opt/harbor/harbor.yaml
- name: run installer
shell:
cmd: ./install.sh
chdir: /opt/harbor/
- name: Read in OIDC-json
set_fact:
oidc_config_json: "{{ lookup('file','harbor-oidc.json') | from_json }}"
- name: Inject OIDC Config
line_in_file:
file: /opt/harbor/common/config/core/env
line: CONFIG_OVERWRITE_JSON={{ oidc_config_json }}
notify: restart harbor