mirror of
https://github.com/FAUSheppy/no-secrets-athq-ansible
synced 2025-12-10 06:58:34 +01:00
feat: rewrite harbor deployment
This commit is contained in:
46
roles/harbor-registry/tasks/main.yaml
Normal file
46
roles/harbor-registry/tasks/main.yaml
Normal 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
|
||||
Reference in New Issue
Block a user