Add harbor to ansible
This commit is contained in:
parent
67d0c8d875
commit
3175b6a42b
13 changed files with 158 additions and 769 deletions
_ansible/roles/harbor/tasks
35
_ansible/roles/harbor/tasks/main.yml
Normal file
35
_ansible/roles/harbor/tasks/main.yml
Normal 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
|
Reference in a new issue