mirror of
https://github.com/FAUSheppy/no-secrets-athq-ansible
synced 2025-12-09 09:48:33 +01:00
feat: harbor setup done
This commit is contained in:
4
group_vars/harbor-registry.yaml
Normal file
4
group_vars/harbor-registry.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
harbor_version: v2.10.0
|
||||||
|
harbor_file: harbor-online-installer-{{ harbor_version }}.tgz
|
||||||
|
harbor_admin_password: 20Dino00
|
||||||
|
harbor_db_password: HISTORY_PURGED_SECRET
|
||||||
@@ -5,10 +5,6 @@
|
|||||||
- docker.io
|
- docker.io
|
||||||
- docker-compose
|
- docker-compose
|
||||||
|
|
||||||
- set_fact:
|
|
||||||
harbor_version: v2.10.0
|
|
||||||
harbor_file: harbor-online-installer-{{ harbor_version }}.tgz
|
|
||||||
|
|
||||||
- name: Create /data/ dir
|
- name: Create /data/ dir
|
||||||
file:
|
file:
|
||||||
path: /data/
|
path: /data/
|
||||||
@@ -23,24 +19,26 @@
|
|||||||
unarchive:
|
unarchive:
|
||||||
remote_src: true
|
remote_src: true
|
||||||
src: /opt/harbor-online-installer-v2.10.0.tgz
|
src: /opt/harbor-online-installer-v2.10.0.tgz
|
||||||
dest: /opt/harbor/
|
dest: /opt/
|
||||||
|
register: release
|
||||||
|
|
||||||
- name: Copy harbor config
|
- name: Copy harbor config
|
||||||
template:
|
template:
|
||||||
src: harbor.config.yaml
|
src: harbor.config.yaml
|
||||||
dest: /opt/harbor/harbor.yaml
|
dest: /opt/harbor/harbor.yml # mind the missing a
|
||||||
|
register: config
|
||||||
|
|
||||||
- name: run installer
|
- name: run installer
|
||||||
shell:
|
shell:
|
||||||
cmd: ./install.sh
|
cmd: ./install.sh
|
||||||
chdir: /opt/harbor/
|
chdir: /opt/harbor/
|
||||||
|
when: config.changed or release.changed
|
||||||
- name: Read in OIDC-json
|
notify: restart harbor
|
||||||
set_fact:
|
|
||||||
oidc_config_json: "{{ lookup('file','harbor-oidc.json') | from_json }}"
|
|
||||||
|
|
||||||
- name: Inject OIDC Config
|
- name: Inject OIDC Config
|
||||||
line_in_file:
|
lineinfile:
|
||||||
file: /opt/harbor/common/config/core/env
|
state: present
|
||||||
line: CONFIG_OVERWRITE_JSON={{ oidc_config_json }}
|
path: /opt/harbor/common/config/core/env
|
||||||
|
line: CONFIG_OVERWRITE_JSON={{ lookup('file','harbor-oidc.json') | from_json | to_json }}
|
||||||
|
regex: CONFIG_OVERWRITE_JSON=
|
||||||
notify: restart harbor
|
notify: restart harbor
|
||||||
|
|||||||
@@ -33,12 +33,12 @@ external_url: https://harbor.atlantishq.de
|
|||||||
# The initial password of Harbor admin
|
# The initial password of Harbor admin
|
||||||
# It only works in first time to install harbor
|
# It only works in first time to install harbor
|
||||||
# Remember Change the admin password from UI after launching Harbor.
|
# Remember Change the admin password from UI after launching Harbor.
|
||||||
harbor_admin_password: Harbor12345
|
harbor_admin_password: {{ harbor_admin_password }}
|
||||||
|
|
||||||
# Harbor DB configuration
|
# Harbor DB configuration
|
||||||
database:
|
database:
|
||||||
# The password for the root user of Harbor DB. Change this before any production use.
|
# The password for the root user of Harbor DB. Change this before any production use.
|
||||||
password: root123
|
password: {{ harbor_db_password }}
|
||||||
# The maximum number of connections in the idle connection pool. If it <=0, no idle connections are retained.
|
# The maximum number of connections in the idle connection pool. If it <=0, no idle connections are retained.
|
||||||
max_idle_conns: 100
|
max_idle_conns: 100
|
||||||
# The maximum number of open connections to the database. If it <= 0, then there is no limit on the number of open connections.
|
# The maximum number of open connections to the database. If it <= 0, then there is no limit on the number of open connections.
|
||||||
|
|||||||
Reference in New Issue
Block a user