Skip to content
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

On-Premises: added possibility to use other device names for existing network interface #8

Merged
merged 1 commit into from
Mar 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/INSTALL_ONPREM.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ all:
1.0.0.5:
vars:
# Choose the IP Detect Script
# options: eth0, eth1, aws, gcp, azure
# options: aws, gcp, azure or eth0, eth1, ... (or other device name for existing network interface)
ip_detect: eth0
# (internal/private) IP Address of the Bootstrap Node
Expand Down
2 changes: 1 addition & 1 deletion hosts.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ all:
1.0.0.5:
vars:
# Choose the IP Detect Script
# options: eth0, eth1, aws, gcp, azure
# options: aws, gcp, azure or eth0, eth1, ... (or other device name for existing network interface)
ip_detect: eth0

# (internal/private) IP Address of the Bootstrap Node
Expand Down
10 changes: 3 additions & 7 deletions roles/bootstrap/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,9 @@
copy: src=fault-domain-detect dest={{ path_bootstrap }}/genconf/fault-domain-detect mode=0644
when: ip_detect == "azure"

- name: set IP detection script for eth0
template: src=ip-detect-eth0.j2 dest={{ path_bootstrap }}/genconf/ip-detect mode=0644
when: ip_detect == "eth0"

- name: set IP detection script for eth1
template: src=ip-detect-eth1.j2 dest={{ path_bootstrap }}/genconf/ip-detect mode=0644
when: ip_detect == "eth1"
- name: set IP detection script for existing network interface
template: src=ip-detect-interface.j2 dest={{ path_bootstrap }}/genconf/ip-detect mode=0644
when: ip_detect != "aws" and ip_detect != "gcp" and ip_detect != "azure"

- name: generate DC/OS configuration with exhibitor backend static
template: src=config-static.yaml.j2 dest={{ path_bootstrap }}/genconf/config.yaml mode=0644
Expand Down
4 changes: 0 additions & 4 deletions roles/bootstrap/templates/ip-detect-eth0.j2

This file was deleted.

4 changes: 0 additions & 4 deletions roles/bootstrap/templates/ip-detect-eth1.j2

This file was deleted.

4 changes: 4 additions & 0 deletions roles/bootstrap/templates/ip-detect-interface.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -o nounset -o errexit
export PATH=/usr/sbin:/usr/bin:$PATH
echo $(ip addr show {{ ip_detect }} | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)