Skip to content

Commit

Permalink
推送ansible执行节点的ssh密钥对至deploy节点
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmzj committed Sep 18, 2018
1 parent 9ff1ffb commit df059f9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion roles/deploy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,14 @@
- name: 移动 kube-proxy.kubeconfig
shell: "mv /root/kube-proxy.kubeconfig /etc/kubernetes/"

# 兼容ansible执行节点与deploy节点分离情况
# --- 以下为兼容ansible执行节点与deploy节点分离情况-------
- name: 复制 manifests至 deploy节点
copy: src={{ base_dir }}/manifests dest={{ base_dir }}
when: "ansible_env['SSH_CLIENT'].split(' ')[0] != inventory_hostname"

- name: 推送 ssh 密钥对至 deploy节点
copy: src=~/.ssh/{{ item }} dest=~/.ssh/{{ item }}
with_items:
- id_rsa
- id_rsa.pub

0 comments on commit df059f9

Please sign in to comment.