Skip to content

Commit

Permalink
Support bastion insert and clean .
Browse files Browse the repository at this point in the history
Signed-off-by: Zheng Xiao Mei <[email protected]>
  • Loading branch information
zhengxiaomei123 committed Jun 2, 2023
1 parent ef523f4 commit 9220b2c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@
- import_playbook: configure-security-groups.yaml
- import_playbook: configure-network.yaml
- import_playbook: configure-bastion-properties.yaml
- import_playbook: configure-dns.yaml
when: use_bastion == true
- import_playbook: configure-haproxy.yaml
when: use_bastion == true
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@
- volume_type_id is defined
- vm_type == "kvm"
- import_playbook: destroy-files.yaml
- import_playbook: destroy-bastion.yaml
when: use_bastion == true

9 changes: 8 additions & 1 deletion z_infra_provisioning/cloud_infra_center/ocp_upi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ Update your settings based on the samples. The following propeties are **require
If you need the Ansible playbook to help configure DNS server or HAProxy server on bastion server, you need to configure correct bastion properties.
| Property| <div style="width:220px">Default</div> | Description |
| --------------------------------------- | ------------------------------------- |:-----|
| `use_bastion` | true | When false, you need configure DNS or HAproxy manually in step 2.
| `ansible_ssh_host` | \<linux server ip addr\> | 'x.x.x.x'<br> **required** when use bastion server, give the IP address of bastion server.
| `bastion_private_ip_address` | \<bastion ip addr\> |IP address of your bastion node<br>**required** when use bastion server, give the IP address of bastion server.
| `dns_forwarder` | \<upstream DNS ip addr\> |For nameserver where requests should be forwarded for resolution.<br>**required** when use bastion server
Expand Down Expand Up @@ -324,7 +325,9 @@ ansible-playbook -i inventory.yaml 01-preparation.yaml

2. **Step2**:

**Note**: This step is optional. You can skip this step if you want to use your external or existing DNS and Load Balancer, you can refer [Add-DNS-HAProxy](docs/add-dns-haproxy.md) to update it.
**Note**: This step is optional.
You can skip this step if you set use_bastion true.
You can skip this step if you want to use your external or existing DNS and Load Balancer, you can refer [Add-DNS-HAProxy](docs/add-dns-haproxy.md) to update it.

> Use this playbook to configure the DNS server and HAProxy, please add `-K` parameter if you use the non-root user, and enter the password for your user.
```sh
Expand All @@ -337,6 +340,10 @@ ansible-playbook -i inventory.yaml bastion.yaml -K
```sh
ansible-playbook -i inventory.yaml configure-haproxy.yaml
```
> If you use your external or existing Load Balancer server, but no Load Balancer, you can refer [Add-DNS-HAProxy](docs/add-dns-haproxy.md) to update Load Balancer part, and use this playbook to configure DNS in your bastion server.
```sh
ansible-playbook -i inventory.yaml configure-dns.yaml
```

3. **Step3**:

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Clean DNS and Haproxy config
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ all:
create_server_timeout: 10 # minute

bastion:
use_bastion: true
ansible_ssh_host: '<linux-server-ip-addr>'
ansible_ssh_common_args: "-o StrictHostKeyChecking=no"
bastion_private_ip_address: '<bastion-ip-addr>'
Expand Down

0 comments on commit 9220b2c

Please sign in to comment.