Add harbor to ansible

This commit is contained in:
Tobias Reisinger 2023-12-11 21:39:01 +01:00
parent 67d0c8d875
commit 3175b6a42b
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
13 changed files with 158 additions and 769 deletions
_ansible/roles/harbor/tasks

View file

@ -0,0 +1,35 @@
---
- name: Deploy {{ svc.name }}
tags:
- harbor
- registry
block:
- import_tasks: steps/create-service-directory.yml
- import_tasks: steps/template-site-config.yml
- name: Template config
ansible.builtin.template:
src: service.yml.j2
dest: "{{ (service_path, 'harbor.yml') | path_join }}"
mode: "0644"
- name: Download harbor
ansible.builtin.unarchive:
src: https://github.com/goharbor/harbor/releases/download/v{{ svc.harbor_version }}/harbor-online-installer-v{{ svc.harbor_version }}.tgz
dest: "{{ service_path }}"
remote_src: yes
- name: Run the harbor prepare command
ansible.builtin.command:
cmd: "{{ service_path }}/harbor/prepare"
chdir: "{{ service_path }}"
environment:
HARBOR_BUNDLE_DIR: "{{ service_path }}"
- name: Run the harbor install command
ansible.builtin.command:
cmd: "{{ service_path }}/harbor/install.sh"
chdir: "{{ service_path }}"
environment:
HARBOR_BUNDLE_DIR: "{{ service_path }}"
become: true