-
-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Corosync role variable handling #75
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3c7034a
use ring0 addr in hosts, which is default_ipv4 anyway by default
gilou 82fdfed
update variable in regexp as well
gilou 2ef5c06
use ring0 addr in the permissive sshd config
gilou 8ffa681
Cluster configuration fixes/cleanup
lae 397aa9f
Break down hosts enumeration strings
lae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
- name: Gather distribution specific variables | ||
include_vars: "debian-{{ ansible_distribution_release }}.yml" | ||
|
||
- block: | ||
# Per Proxmox documentation, bindnet_addr is expected to be an IP address and | ||
# ring_addr can be either hostname or IP, but this role has always used an IP | ||
# address. Thus, we're deprecating them. See below references. | ||
# https://pve.proxmox.com/wiki/Separate_Cluster_Network#Setup_at_Cluster_Creation | ||
# https://git.proxmox.com/?p=pve-cluster.git;a=blob;f=data/PVE/Corosync.pm;h=8b5c91e0da084da4e9ba7423176872a0c16ef5af;hb=refs/heads/stable-5#l209 | ||
- name: LEGACY - Define pve_cluster_addr0 from bindnet0_addr/ring0_addr | ||
set_fact: | ||
pve_cluster_addr0: "{{ pve_cluster_bindnet0_addr | default(pve_cluster_ring0_addr) }}" | ||
when: pve_cluster_ring0_addr is defined and ansible_distribution_release == 'stretch' | ||
|
||
- name: LEGACY - Define pve_cluster_addr0 from link0_addr | ||
set_fact: | ||
pve_cluster_addr0: "{{ pve_cluster_link0_addr }}" | ||
when: pve_cluster_link0_addr is defined and ansible_distribution_release == 'buster' | ||
when: pve_cluster_addr0 is not defined | ||
|
||
- block: | ||
- name: LEGACY - Define pve_cluster_addr1 from bindnet1_addr/ring1_addr | ||
set_fact: | ||
pve_cluster_addr1: "{{ pve_cluster_bindnet1_addr | default(pve_cluster_ring1_addr) }}" | ||
when: pve_cluster_ring1_addr is defined and ansible_distribution_release == 'stretch' | ||
|
||
- name: LEGACY - Define pve_cluster_addr1 from link1_addr | ||
set_fact: | ||
pve_cluster_addr1: "{{ pve_cluster_link1_addr }}" | ||
when: pve_cluster_link1_addr is defined and ansible_distribution_release == 'buster' | ||
when: pve_cluster_addr1 is not defined | ||
|
||
- name: Define pve_cluster_addr0 if not provided | ||
set_fact: | ||
pve_cluster_addr0: "{{ pve_cluster_addr0 | default(_pve_cluster_addr0) }}" | ||
|
||
- name: Calculate list of SSH addresses | ||
set_fact: | ||
pve_cluster_ssh_addrs: >- | ||
["{{ ansible_fqdn }}", "{{ ansible_hostname }}", | ||
"{{ pve_cluster_addr0 }}", | ||
{% if pve_cluster_addr1 is defined %}"{{ pve_cluster_addr1 }}"{% endif %}] |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just my two cents, I've learned, that the default interfaces may change. For example docker installations add docker0 and then because d is before e, the default interfaces in ansible changes. Maybe we should mention that. I've added somewhere else in my playbook a set_fact based on a filter of all interfaces starting with 'e' to get the first address. But when you use more then one ethernet device, this will maybe overridden. Nothing to change here.