Move _ansible directory into main directory
This commit is contained in:
parent
519882db43
commit
40742e3214
124 changed files with 246 additions and 141 deletions
roles/harbor/tasks
44
roles/harbor/tasks/main.yml
Normal file
44
roles/harbor/tasks/main.yml
Normal file
|
@ -0,0 +1,44 @@
|
|||
---
|
||||
- name: Set common facts
|
||||
ansible.builtin.import_tasks: tasks/set-default-facts.yml
|
||||
|
||||
- name: Deploy {{ svc.name }}
|
||||
vars:
|
||||
svc: "{{ harbor_svc }}"
|
||||
env: "{{ harbor_env }}"
|
||||
yml: "{{ harbor_yml }}"
|
||||
block:
|
||||
- name: Import prepare tasks for common service
|
||||
ansible.builtin.import_tasks: tasks/prepare-common-service.yml
|
||||
|
||||
- name: Import tasks to template the site for the reverse proxy
|
||||
ansible.builtin.import_tasks: 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: true
|
||||
|
||||
- name: Run the harbor prepare command
|
||||
ansible.builtin.command:
|
||||
cmd: "{{ service_path }}/harbor/prepare"
|
||||
chdir: "{{ service_path }}"
|
||||
creates: "{{ (service_path, 'docker-compose.yml') | path_join }}"
|
||||
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
|
||||
changed_when: true # TODO find way to recognize need to run install command
|
Reference in a new issue