kubeasz/11.harbor.yml

27 lines
706 B
YAML
Raw Normal View History

2017-12-25 15:05:21 +08:00
- hosts: harbor
roles:
2018-08-17 12:27:25 +08:00
- { role: chrony, when: "hostvars[groups.deploy[0]]['NTP_ENABLED'] == 'yes'" }
2017-12-25 15:05:21 +08:00
- prepare
- docker
- harbor
2018-02-26 20:45:17 +08:00
- hosts:
- kube-master
2018-05-04 22:11:08 +08:00
- new-master
2018-02-26 20:45:17 +08:00
- kube-node
- new-node
2017-12-25 15:05:21 +08:00
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
2017-12-25 15:05:21 +08:00
2018-05-04 22:11:08 +08:00
# 如果你的环境中有dns服务器可以跳过hosts文件设置
2017-12-25 15:05:21 +08:00
- name: 增加harbor的hosts解析
2018-05-04 22:11:08 +08:00
lineinfile:
dest: /etc/hosts
state: present
regexp: '{{ HARBOR_DOMAIN }}'
line: '{{ HARBOR_IP }} {{ HARBOR_DOMAIN }}'