forked from kubernetes-sigs/kubespray
-
Notifications
You must be signed in to change notification settings - Fork 6
/
host-key.yml
38 lines (34 loc) · 1.04 KB
/
host-key.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
- name: Check ansible version
import_playbook: ansible_version.yml
- hosts: all
gather_facts: false
tags: always
tasks:
- name: "Set up proxy environment"
set_fact:
proxy_env:
http_proxy: "{{ http_proxy | default ('') }}"
HTTP_PROXY: "{{ http_proxy | default ('') }}"
https_proxy: "{{ https_proxy | default ('') }}"
HTTPS_PROXY: "{{ https_proxy | default ('') }}"
no_proxy: "{{ no_proxy | default ('') }}"
NO_PROXY: "{{ no_proxy | default ('') }}"
no_log: true
- hosts: bastion[0]
gather_facts: False
roles:
- { role: kubespray-defaults }
- { role: bastion-ssh-config, tags: ["localhost", "bastion"] }
- hosts: all
gather_facts: False
tasks:
- name: Gen ssh certs
shell: |
ssh-keygen -t rsa -f {{ rsa_cert_path }}/id_rsa -P ""
delegate_to: localhost
run_once: true
tags:
- gen-cert
- name: ssh-copy
authorized_key: user={{ ansible_user }} key="{{ lookup('file', '{{ rsa_cert_path }}/id_rsa.pub') }}"