summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorZenghui Shi <zshi@redhat.com>2018-04-04 11:24:40 +0800
committerFeng Pan <fpan@redhat.com>2018-07-06 16:13:06 -0400
commit10c4d35315d7ffd909520a1c7bc6a3b5b9b871ab (patch)
treee7ab984038098b931d82527f52d2a85a35fdd780 /lib
parentae22c3358b53a68b68de7d3ac5d6f56a1c384b61 (diff)
Add support for kubernetes deployment
This patch adds capability to deploy kubernetes cluster instead of openstack. Kubernetes will be deployed using kubespray and is run after TripleO bookstraps overcloud nodes. JIRA: APEX-574 Change-Id: If9c171620c933a052b719e7112a50e22bbab667f Signed-off-by: Feng Pan <fpan@redhat.com> Signed-off-by: Zenghui Shi <zshi@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/ansible/playbooks/deploy_dependencies.yml6
-rw-r--r--lib/ansible/playbooks/deploy_overcloud.yml3
-rw-r--r--lib/ansible/playbooks/k8s_remove_pkgs.yml5
-rw-r--r--lib/ansible/playbooks/post_deploy_undercloud.yml5
4 files changed, 16 insertions, 3 deletions
diff --git a/lib/ansible/playbooks/deploy_dependencies.yml b/lib/ansible/playbooks/deploy_dependencies.yml
index fb1da46f..1cc304a5 100644
--- a/lib/ansible/playbooks/deploy_dependencies.yml
+++ b/lib/ansible/playbooks/deploy_dependencies.yml
@@ -8,6 +8,12 @@
- python-lxml
- libvirt-python
- libguestfs-tools
+ - python-netaddr
+ - python2-pip
+ - pip:
+ name: ansible-modules-hashivault,hvac,Jinja2
+ state: latest
+ executable: pip2
- sysctl:
name: net.ipv4.ip_forward
state: present
diff --git a/lib/ansible/playbooks/deploy_overcloud.yml b/lib/ansible/playbooks/deploy_overcloud.yml
index 0039256d..c3094cb1 100644
--- a/lib/ansible/playbooks/deploy_overcloud.yml
+++ b/lib/ansible/playbooks/deploy_overcloud.yml
@@ -15,6 +15,7 @@
- deploy_command
- virtual-environment.yaml
- baremetal-environment.yaml
+ - kubernetes-environment.yaml
- "{{ apex_env_file }}"
- name: Copy network data to undercloud
copy:
@@ -112,7 +113,7 @@
become: yes
- name: Show Keystone output
shell: "{{ overcloudrc }} && {{ item }}"
- when: debug
+ when: debug and vim == 'openstack'
with_items:
- openstack endpoint list
- openstack service list
diff --git a/lib/ansible/playbooks/k8s_remove_pkgs.yml b/lib/ansible/playbooks/k8s_remove_pkgs.yml
new file mode 100644
index 00000000..f9fa7787
--- /dev/null
+++ b/lib/ansible/playbooks/k8s_remove_pkgs.yml
@@ -0,0 +1,5 @@
+---
+- hosts: all
+ tasks:
+ - name: Removing existing docker related packages
+ shell: "rpm -e --nodeps docker docker-common docker-client container-selinux"
diff --git a/lib/ansible/playbooks/post_deploy_undercloud.yml b/lib/ansible/playbooks/post_deploy_undercloud.yml
index d0206f87..24be1ded 100644
--- a/lib/ansible/playbooks/post_deploy_undercloud.yml
+++ b/lib/ansible/playbooks/post_deploy_undercloud.yml
@@ -9,6 +9,7 @@
- name: Configure external network
shell: "{{ overcloudrc }} && {{ item }}"
with_items: "{{ external_network_cmds }}"
+ when: vim == 'openstack'
- name: Configure gluon networks
shell: "{{ overcloudrc }} && {{ item }}"
when: gluon
@@ -76,8 +77,7 @@
- name: Register OS Region
shell: "{{ overcloudrc }} && openstack endpoint list -c Region -f json"
register: region
- become: yes
- become_user: stack
+ when: vim == 'openstack'
- name: Write Region into overcloudrc
lineinfile:
line: "export OS_REGION_NAME={{(region.stdout|from_json)[1]['Region']}}"
@@ -86,6 +86,7 @@
become: yes
become_user: stack
with_items: "{{ overcloudrc_files }}"
+ when: vim == 'openstack'
- name: Create congress datasources
shell: "{{ overcloudrc }} && openstack congress datasource create {{ item }}"
become: yes