forked from IBM/z_ansible_collections_samples
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/IBM/z_ansible_collections_s…
- Loading branch information
Showing
19 changed files
with
288 additions
and
35 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
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
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
31 changes: 31 additions & 0 deletions
31
z_infra_provisioning/cloud_infra_center/ocp_upi/configure-dhcp.yaml
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,31 @@ | ||
# ================================================================= | ||
# Copyright 2024 https://github.com/multi-arch/multiarch-ci-playbooks | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# ================================================================= | ||
|
||
# ================================================================= | ||
# Licensed Materials - Property of IBM | ||
# | ||
# (c) Copyright IBM Corp. 2024 All Rights Reserved | ||
# | ||
# US Government Users Restricted Rights - Use, duplication or | ||
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. | ||
# ================================================================= | ||
# | ||
|
||
--- | ||
- name: Configure dns on bastion | ||
hosts: bastion | ||
roles: | ||
- configure-dhcp |
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
22 changes: 22 additions & 0 deletions
22
z_infra_provisioning/cloud_infra_center/ocp_upi/dhcp_template.yaml
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,22 @@ | ||
static_hosts: | ||
bootstrap: | ||
mac: "00:11:22:33:44:55" | ||
ip: "10.1.0.10" | ||
master-0: | ||
mac: "00:11:22:33:44:56" | ||
ip: "10.1.0.11" | ||
master-1: | ||
mac: "00:11:22:33:44:57" | ||
ip: "10.1.0.12" | ||
master-2: | ||
mac: "00:11:22:33:44:58" | ||
ip: "10.1.0.13" | ||
worker-0: | ||
mac: "00:11:22:33:44:59" | ||
ip: "10.1.0.14" | ||
worker-1: | ||
mac: "00:11:22:33:44:60" | ||
ip: "10.1.0.15" | ||
worker-2: | ||
mac: "00:11:22:33:44:61" | ||
ip: "10.1.0.16" |
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
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
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
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
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
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
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
60 changes: 60 additions & 0 deletions
60
z_infra_provisioning/cloud_infra_center/ocp_upi/roles/configure-dhcp/tasks/main.yaml
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,60 @@ | ||
# ================================================================= | ||
# Copyright 2024 https://github.com/multi-arch/multiarch-ci-playbooks | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# ================================================================== | ||
|
||
--- | ||
# tasks file for configure-dhcp | ||
- ansible.builtin.include_vars: dhcp_template.yaml | ||
|
||
- name: 'Remove the /etc/dhcp/dhcpd.conf' | ||
ansible.builtin.file: | ||
state: absent | ||
path: /etc/dhcp/dhcpd.conf | ||
|
||
- name: Install DHCP server package | ||
package: | ||
name: dhcp-server.s390x | ||
state: present | ||
become: true | ||
|
||
- name: Configure dhcpd.conf file | ||
template: | ||
src: etc/dhcp/dhcpd.conf.j2 | ||
dest: /etc/dhcp/dhcpd.conf | ||
|
||
- name: Get the subnet range from localhost | ||
ansible.builtin.set_fact: | ||
subnet_range: "{{ lookup('file', '.subnet_range.yml') }}" | ||
|
||
- name: Set_fact for the the subnet range | ||
ansible.builtin.set_fact: | ||
cluster_subnet_range: "{{ subnet_range | regex_replace('/.*', '') }}" | ||
|
||
- name: Convert CIDR to netmask | ||
ansible.builtin.set_fact: | ||
netmask_result: "{{ subnet_range | ipaddr('netmask') }}" | ||
|
||
- name: Update cluster_subnet_range | ||
ansible.builtin.shell: | ||
cmd: sed -i "s|dhcp_subnet| {{ cluster_subnet_range }} |g" /etc/dhcp/dhcpd.conf | ||
|
||
- name: Update cic_subnet_mask | ||
ansible.builtin.shell: | ||
cmd: sed -i "s|cic_subnet_mask|{{ netmask_result }}|g" /etc/dhcp/dhcpd.conf | ||
|
||
- name: restart dhcpd | ||
service: | ||
name: dhcpd | ||
state: restarted |
29 changes: 29 additions & 0 deletions
29
...isioning/cloud_infra_center/ocp_upi/roles/configure-dhcp/templates/etc/dhcp/dhcpd.conf.j2
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,29 @@ | ||
# Global options | ||
option domain-name "{{ cluster_name }}.{{ base_domain }}"; | ||
option domain-name-servers {{ os_dns_domain }},{{ dns_forwarder }}; | ||
|
||
default-lease-time 600; | ||
max-lease-time 7200; | ||
|
||
ddns-update-style interim; | ||
ignore client-updates; | ||
allow booting; | ||
allow bootp; | ||
log-facility local7; | ||
|
||
# Subnet configuration | ||
subnet dhcp_subnet netmask cic_subnet_mask { | ||
# Default gateway | ||
option routers {{ dns_forwarder }}; | ||
option subnet-mask cic_subnet_mask; | ||
option time-offset -18000; | ||
} | ||
|
||
# Static IP assignments | ||
{% for host, info in static_hosts.items() %} | ||
host {{ host }} { | ||
hardware ethernet {{ info.mac }}; | ||
fixed-address {{ info.ip }}; | ||
option domain-name-servers {{ os_dns_domain }},{{ dns_forwarder }}; | ||
} | ||
{% endfor %} |
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
Oops, something went wrong.