kubeasz/11.harbor.yml

26 lines
625 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

- hosts: harbor
roles:
- prepare
- docker
- harbor
- hosts:
- kube-master
- new-master
- kube-node
- new-node
tasks:
- name: harbor证书目录创建
file: name=/etc/docker/certs.d/{{ HARBOR_DOMAIN }} state=directory
- name: harbor服务器证书安装
copy: src={{ ca_dir }}/ca.pem dest=/etc/docker/certs.d/{{ HARBOR_DOMAIN }}/ca.crt
# 如果你的环境中有dns服务器可以跳过hosts文件设置
- name: 增加harbor的hosts解析
lineinfile:
dest: /etc/hosts
state: present
regexp: '{{ HARBOR_DOMAIN }}'
line: '{{ HARBOR_IP }} {{ HARBOR_DOMAIN }}'