This repository has been archived on 2024-11-01. You can view files and clone it, but cannot push or open issues or pull requests.
services/_ansible/roles/harbor/tasks/main.yml

36 lines
1.1 KiB
YAML
Raw Normal View History

2023-12-11 20:39:01 +00:00
---
- 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