Skip to content

Commit

Permalink
Merge pull request #8 from rembik/master
Browse files Browse the repository at this point in the history
On-Premises: added possibility to use other device names for existing network interface
  • Loading branch information
Jan Repnak authored Mar 10, 2018
2 parents 4206f6f + a09406d commit 70764b6
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 17 deletions.
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)

0 comments on commit 70764b6

Please sign in to comment.