Ansible.Harbor/roles/registry/tasks/main.yml

36 lines
930 B
YAML
Raw Normal View History

2021-03-19 12:32:52 +00:00
- name: Download Harbor installer
get_url:
url: https://github.com/goharbor/harbor/releases/download/{{ harbor.version }}/harbor-online-installer-{{ harbor.version }}.tgz
2021-03-19 12:32:52 +00:00
dest: /tmp/harbor-installer.tgz
mode: '0777'
2023-02-22 14:52:45 +00:00
2021-03-19 12:32:52 +00:00
- name: Extract installer
unarchive:
src: /tmp/harbor-installer.tgz
2021-04-03 14:11:21 +00:00
dest: /opt
2021-03-19 12:32:52 +00:00
remote_src: yes
2023-02-22 14:52:45 +00:00
2021-03-19 12:32:52 +00:00
- name: Copy Harbor configuration file and public/private keys
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
backup: "{{ item.backup }}"
with_items:
- src: harbor.yml
2021-04-03 14:11:21 +00:00
dest: /opt/harbor
2021-03-19 12:32:52 +00:00
backup: yes
- src: /certificates/*.bessems.eu/certificate.crt
2021-04-03 14:11:21 +00:00
dest: /opt/harbor
2021-03-19 12:32:52 +00:00
backup: no
- src: /certificates/*.bessems.eu/privatekey.key
2021-04-03 14:11:21 +00:00
dest: /opt/harbor
2021-03-19 12:32:52 +00:00
backup: no
2023-02-22 14:52:45 +00:00
2021-03-19 12:32:52 +00:00
- name: Install Harbor
2021-04-03 14:11:21 +00:00
command: /opt/harbor/install.sh --with-trivy
2023-02-22 14:52:45 +00:00
2021-03-19 12:32:52 +00:00
- name: Delete temporary files
file:
path: /tmp/harbor-installer.tgz
state: absent