-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Prajyot Parab <[email protected]>
- Loading branch information
1 parent
b07c89d
commit 5d837d8
Showing
4 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
|
||
ibm_cloud_dl_endpoint_net_cidr: "" #IBM Cloud DirectLink endpoint network cidr eg. 10.0.0.0/8 | ||
ibm_cloud_http_proxy: "" #IBM Cloud http/squid proxy eg. http://10.166.13.64:3128 | ||
ocp_node_net_gw: "" #OCP node private network gateway eg. 192.168.25.1 | ||
ocp_node_net_intf: "" #OCP node private network interface name eg. env3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
- name: PowerVS specific configuration | ||
hosts: bastion | ||
roles: | ||
- powervs-nodes-config | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
powervs-nodes-config: PowerVS OCP Cluster Nodes Configuration | ||
========= | ||
|
||
This module will enable connectivity between OCP nodes in PowerVS and IBM Cloud infrastructure over DirectLink. | ||
|
||
Requirements | ||
------------ | ||
|
||
- A working OCP 4.X cluster | ||
- OCP cluster private network advertised over IBM Cloud DirectLink. | ||
- Running proxy service on classic infrastructure. | ||
|
||
Role Variables | ||
-------------- | ||
|
||
| Variable | Required | Default | Comments | | ||
|--------------------------------|----------|---------|---------------------------------------------------------------| | ||
| ibm_cloud_dl_endpoint_net_cidr | yes | | IBM Cloud DirectLink endpoint network cidr eg. 10.0.0.0/8 | | ||
| ibm_cloud_http_proxy | yes | | IBM Cloud http/squid proxy url eg. `http://10.166.13.64:3128` | | ||
| ocp_node_net_gw | yes | | OCP node private network gateway eg. 192.168.25.1 | | ||
| ocp_node_net_intf | yes | | OCP node private network interface name eg. env3 | | ||
|
||
Dependencies | ||
------------ | ||
|
||
- None | ||
|
||
Example Playbook | ||
---------------- | ||
|
||
- name: PowerVS specific nodes configuration | ||
hosts: bastion | ||
roles: | ||
- powervs-nodes-config | ||
|
||
License | ||
------- | ||
|
||
See LICENCE.txt | ||
|
||
Author Information | ||
------------------ | ||
|
||
Prajyot Parab ([email protected]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
# tasks file for powervs nodes configuration | ||
|
||
- name: Get Connection UUID | ||
shell: | | ||
nmcli -g uuid,device con | grep {{ ocp_node_net_intf }} | awk -F: '{ print $1 }' | ||
register: con_uuid | ||
|
||
- name: Add route to connection | ||
shell: | | ||
nmcli connection modify {{ con_uuid.stdout }} +ipv4.routes "{{ ibm_cloud_dl_endpoint_net_cidr }} {{ ocp_node_net_gw }}" | ||
nmcli connection up {{ con_uuid.stdout }} | ||
- name: Retrieve proxy details | ||
shell: | | ||
oc get proxy/cluster -o template --template {{'{{'}}.spec.noProxy{{'}}'}} | ||
register: proxy | ||
run_once: true | ||
|
||
- name: Switch to classic infrastructure proxy | ||
shell: | | ||
oc patch proxy/cluster --type merge --patch '{"spec":{"httpProxy": "{{ ibm_cloud_http_proxy }}", "httpsProxy": "{{ ibm_cloud_http_proxy }}", "noProxy": "{{ proxy.stdout }},{{ ibm_cloud_dl_endpoint_net_cidr }}" }}' | ||
run_once: true | ||
|