summaryrefslogtreecommitdiffstats
path: root/xci/installer/kubespray/playbooks
diff options
context:
space:
mode:
Diffstat (limited to 'xci/installer/kubespray/playbooks')
-rw-r--r--xci/installer/kubespray/playbooks/configure-opnfvhost.yml30
-rw-r--r--xci/installer/kubespray/playbooks/configure-targethosts.yml8
2 files changed, 14 insertions, 24 deletions
diff --git a/xci/installer/kubespray/playbooks/configure-opnfvhost.yml b/xci/installer/kubespray/playbooks/configure-opnfvhost.yml
index a4bdbf07..0ac18b50 100644
--- a/xci/installer/kubespray/playbooks/configure-opnfvhost.yml
+++ b/xci/installer/kubespray/playbooks/configure-opnfvhost.yml
@@ -30,18 +30,6 @@
recursive: yes
delete: yes
- - name: generate SSH keys
- command: ssh-keygen -b 2048 -t rsa -f /root/.ssh/id_rsa -q -N ""
- args:
- creates: /root/.ssh/id_rsa
- - name: add id_rsa.pub to authorized_keys
- shell: cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
- when: xci_flavor == 'aio'
- - name: fetch public key
- fetch:
- src: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub"
- dest: "{{ xci_path }}/xci/files/authorized_keys"
- flat: yes
- name: delete the opnfv_inventory directory
file:
path: "{{ remote_xci_path }}/.cache/repos/kubespray/opnfv_inventory"
@@ -60,6 +48,7 @@
{{ remote_xci_path }}/.cache/repos/kubespray/opnfv_inventory/group_vars"
args:
creates: "{{ remote_xci_path }}/.cache/repos/kubespray/opnfv_inventory/group_vars/k8s-cluster.yml"
+ - include: "{{ xci_path }}/xci/playbooks/bootstrap-scenarios.yml"
- name: Install required packages
package:
name: "{{ kube_require_packages[ansible_pkg_mgr] }}"
@@ -78,12 +67,13 @@
name: ansible
version: "{{ xci_kube_ansible_pip_version }}"
+ - name: Configure SSL certificates
+ include_tasks: "{{ xci_path }}/xci/playbooks/manage-ssl-certs.yml"
-- hosts: localhost
- remote_user: root
- vars_files:
- - "{{ xci_path }}/xci/var/opnfv.yml"
- tasks:
- - name: Append public keys to authorized_keys
- shell: "/bin/cat {{ ansible_env.HOME }}/.ssh/id_rsa.pub >> {{ xci_path }}/xci/files/authorized_keys"
- changed_when: True
+ - name: fetch xci environment
+ copy:
+ src: "{{ xci_path }}/.cache/xci.env"
+ dest: /root/xci.env
+
+ - name: Manage SSH keys
+ include_tasks: "{{ xci_path }}/xci/playbooks/manage-ssh-keys.yml"
diff --git a/xci/installer/kubespray/playbooks/configure-targethosts.yml b/xci/installer/kubespray/playbooks/configure-targethosts.yml
index d89cd334..dd7024fb 100644
--- a/xci/installer/kubespray/playbooks/configure-targethosts.yml
+++ b/xci/installer/kubespray/playbooks/configure-targethosts.yml
@@ -2,10 +2,8 @@
- hosts: all
remote_user: root
tasks:
- - name: add public key to host
- copy:
- src: "{{ xci_path }}/xci/files/authorized_keys"
- dest: /root/.ssh/authorized_keys
+ - name: Manage SSH keys
+ include_tasks: "{{ xci_path }}/xci/playbooks/manage-ssh-keys.yml"
- name: Install required packages
package:
name: "{{ kube_require_packages[ansible_pkg_mgr] }}"
@@ -25,4 +23,6 @@
when: xci_flavor == 'ha'
- role: "haproxy_server"
haproxy_service_configs: "{{ haproxy_default_services}}"
+ haproxy_user_ssl_cert: "/etc/ssl/certs/xci.crt"
+ haproxy_user_ssl_key: "/etc/ssl/private/xci.key"
when: xci_flavor == 'ha'