-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #212 from ccamacho/test-ovn
feat: allow deploying the service node in any chassis
- Loading branch information
Showing
11 changed files
with
185 additions
and
110 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
--- | ||
# Copyright kubeinit.com | ||
# All Rights Reserved. | ||
# | ||
# 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. | ||
|
||
## | ||
## Hypervisor installing dependencies and rebooting. | ||
## | ||
- name: Set up an Hypervisors | ||
block: | ||
|
||
- name: "check if the external bridge is created when using the external interface" | ||
ansible.builtin.shell: | | ||
set -o pipefail | ||
nmcli con show | grep {{ kubeinit_libvirt_external_service_interface.attached }} | ||
register: bridge_status | ||
ignore_errors: yes | ||
when: | | ||
(hostvars[ groups['all'] | map('regex_search','^.*service.*$') | select('string') | list | first ].target in kubeinit_deployment_node_name) and | ||
kubeinit_libvirt_external_service_interface_enabled | ||
- name: Fail if the external bridge is not created when using the external interface | ||
ansible.builtin.fail: | ||
msg: | ||
- "The bridge {{ kubeinit_libvirt_external_service_interface.attached }} to provide external" | ||
- "connectivity is not created. This is a requirement that needs to be" | ||
- "created before running the playbook." | ||
- "You must create {{ kubeinit_libvirt_external_service_interface.attached }} in" | ||
- "{{ hostvars[ groups['all'] | map('regex_search','^.*service.*$') | select('string') | list | first ].target }}" | ||
- "before continue." | ||
- "Run `nmcli con show` and check it is created correctly." | ||
- "********************************************************************" | ||
- "* WARNING: Make sure that if you use OVN, you *" | ||
- "* create an OVS bridge, and if you use libvirt then, *" | ||
- "* a Linux bridge. *" | ||
- "* Refer to: http://docs.kubeinit.com/usage.html#external-interface *" | ||
- "* for further details. *" | ||
- "********************************************************************" | ||
when: | | ||
(hostvars[ groups['all'] | map('regex_search','^.*service.*$') | select('string') | list | first ].target in kubeinit_deployment_node_name) and | ||
kubeinit_libvirt_external_service_interface_enabled and | ||
bridge_status.rc != 0 | ||
- name: Fails if OS is not supported | ||
ansible.builtin.fail: | ||
msg: The hypervisor machine needs to be CentOS/RHEL | ||
when: not (ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat' or ansible_distribution == 'Fedora' or ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu') | ||
|
||
- name: Fails if CentOS 7 hypervisor | ||
ansible.builtin.fail: | ||
msg: | ||
- "CentOS 7 is not supported as CentOS 8 guests are used." | ||
- "Refer to: https://access.redhat.com/solutions/4073061" | ||
- "This issue is caused by the forward compatibility of xfs" | ||
- "file system between CentOS 7 and CentOS 8." | ||
- "Xfs file system in CentOS 8 uses reflink and sparse files," | ||
- "but CentOS 7 kernel does not understand them and refuses to mount it." | ||
when: (ansible_distribution == 'CentOS' and ansible_distribution_major_version == "7") | ||
|
||
# In this case the node will be an hypervisor | ||
delegate_to: "{{ kubeinit_deployment_node_name }}" | ||
tags: | ||
- provision_libvirt |
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.