browbeat/ocp_on_osp/ocp_bootstrap.yml
rajeshP524 0ae5a7cebc Install Ocp on Osp
This patch introduces a new workload called "ocp_on_osp".
This workload installs Openshift cluster on Openstack as
a part of Dynamic Workloads.

Change-Id: I5c0a1ef04bf0e82563e7d17fdd9688f938d1e33f
2022-09-22 13:28:31 +05:30

76 lines
2.3 KiB
YAML

---
- hosts: localhost
gather_facts: true
vars_files:
- vars/shift_stack_vars.yaml
tasks:
- name: Get Binaries
block:
- name: Set url for installer
set_fact:
ocp_installer_url: https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/
when: ocp_dev_preview == false
- name: Set url for installer
set_fact:
ocp_installer_url: https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp-dev-preview/
when: ocp_dev_preview
- name: Get the latest installer
get_url:
validate_certs: no
force: true
url: "{{ ocp_installer_url }}{{ ocp_release }}/openshift-install-linux.tar.gz"
dest: /home/stack/openshift-install-linux.tar.gz
- name: Untar installer
unarchive:
src: /home/stack/openshift-install-linux.tar.gz
dest: /home/stack/
remote_src: yes
- name: Get the ocp client
get_url:
validate_certs: no
force: true
url: "{{ ocp_installer_url }}{{ ocp_release }}/openshift-client-linux.tar.gz"
dest: /home/stack/openshift-client-linux.tar.gz
- name: Untar ocp client
unarchive:
src: /home/stack/openshift-client-linux.tar.gz
dest: /home/stack/
remote_src: yes
mode: 0700
- name: Copy oc to bin
become: true
shell: |
cp /home/stack/oc /usr/local/bin
cp /home/stack/kubectl /usr/local/bin
chmod a+x /usr/local/bin/oc
chmod a+x /usr/local/bin/kubectl
# End block
- name: create flavors
include_tasks: tasks/create_flavors.yml
- name: create new overcloudrc file as ocp_venvrc, to be used while setting shiftstack quotas to unlimited
shell: |
sed 's/.*OS_COMPUTE_API_VERSION.*/export OS_COMPUTE_API_VERSION=2.79/' /home/stack/overcloudrc > /home/stack/ocp_venvrc
- name: create ansible log directory
shell: mkdir -p /home/stack/ocp_ansible_logs/
- name: flush iptables
shell: sudo iptables --flush
- name: get default route
shell: |
sudo ip r | grep default | cut -d ' ' -f5
register: default_route
- name: masquerade on public interface
shell: |
sudo iptables -t nat -A POSTROUTING -o {{ default_route.stdout }} -j MASQUERADE