Skip to content

Commit 070f6eb

Browse files
Prajyot-Parabyussufsh
authored andcommitted
IBM Cloud DirectLink support
Signed-off-by: Prajyot Parab <[email protected]>
1 parent c6e6038 commit 070f6eb

File tree

4 files changed

+82
-0
lines changed

4 files changed

+82
-0
lines changed

examples/powervs_config_vars.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
3+
ibm_cloud_dl_endpoint_net_cidr: "" #IBM Cloud DirectLink endpoint network cidr eg. 10.0.0.0/8
4+
ibm_cloud_http_proxy: "" #IBM Cloud http/squid proxy eg. http://10.166.13.64:3128
5+
ocp_node_net_gw: "" #OCP node private network gateway eg. 192.168.25.1
6+
ocp_node_net_intf: "" #OCP node private network interface name eg. env3
7+

playbooks/powervs_config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
- name: PowerVS specific configuration
3+
hosts: bastion
4+
roles:
5+
- powervs-nodes-config
6+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
powervs-nodes-config: PowerVS OCP Cluster Nodes Configuration
2+
=========
3+
4+
This module will enable connectivity between OCP nodes in PowerVS and IBM Cloud infrastructure over DirectLink.
5+
6+
Requirements
7+
------------
8+
9+
- A working OCP 4.X cluster
10+
- OCP cluster private network advertised over IBM Cloud DirectLink.
11+
- Running proxy service on classic infrastructure.
12+
13+
Role Variables
14+
--------------
15+
16+
| Variable | Required | Default | Comments |
17+
|--------------------------------|----------|---------|---------------------------------------------------------------|
18+
| ibm_cloud_dl_endpoint_net_cidr | yes | | IBM Cloud DirectLink endpoint network cidr eg. 10.0.0.0/8 |
19+
| ibm_cloud_http_proxy | yes | | IBM Cloud http/squid proxy url eg. `http://10.166.13.64:3128` |
20+
| ocp_node_net_gw | yes | | OCP node private network gateway eg. 192.168.25.1 |
21+
| ocp_node_net_intf | yes | | OCP node private network interface name eg. env3 |
22+
23+
Dependencies
24+
------------
25+
26+
- None
27+
28+
Example Playbook
29+
----------------
30+
31+
- name: PowerVS specific nodes configuration
32+
hosts: bastion
33+
roles:
34+
- powervs-nodes-config
35+
36+
License
37+
-------
38+
39+
See LICENCE.txt
40+
41+
Author Information
42+
------------------
43+
44+
Prajyot Parab ([email protected])
45+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
# tasks file for powervs nodes configuration
3+
4+
- name: Get Connection UUID
5+
shell: |
6+
nmcli -g uuid,device con | grep {{ ocp_node_net_intf }} | awk -F: '{ print $1 }'
7+
register: con_uuid
8+
9+
- name: Add route to connection
10+
shell: |
11+
nmcli connection modify {{ con_uuid.stdout }} +ipv4.routes "{{ ibm_cloud_dl_endpoint_net_cidr }} {{ ocp_node_net_gw }}"
12+
nmcli connection up {{ con_uuid.stdout }}
13+
14+
- name: Retrieve proxy details
15+
shell: |
16+
oc get proxy/cluster -o template --template {{'{{'}}.spec.noProxy{{'}}'}}
17+
register: proxy
18+
run_once: true
19+
20+
- name: Switch to classic infrastructure proxy
21+
shell: |
22+
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 }}" }}'
23+
run_once: true
24+

0 commit comments

Comments
 (0)