-
Notifications
You must be signed in to change notification settings - Fork 14
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 #29 from greg-hellings/add_flexible_hostname_ip
Add optional IP address for hostnames
- Loading branch information
Showing
6 changed files
with
31 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,3 @@ driver: | |
name: openstack | ||
platforms: | ||
- name: hostname_default | ||
provisioner: | ||
playbooks: | ||
converge: playbook.yml |
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,9 @@ | ||
driver: | ||
name: openstack | ||
platforms: | ||
- name: hostname_default | ||
provisioner: | ||
inventory: | ||
group_vars: | ||
all: | ||
hostname_inject_hosts_ip_address: "1.2.3.4" |
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,20 @@ | ||
def test_hostname_set(host): | ||
assert host.run("hostname -f").stdout.strip() == "dev.example.com" | ||
|
||
|
||
def test_hostname_resolves(host): | ||
cmd = _call(host, 'dev.example.com') | ||
assert cmd == '1.2.3.4' | ||
|
||
|
||
def test_hostname_aliases_resolve(host): | ||
cmd = _call(host, 'dev') | ||
assert cmd == '1.2.3.4' | ||
|
||
|
||
def _call(host, name): | ||
cmd = host.run("ping -c 1 dev.example.com") | ||
lines = cmd.stdout.split("\n") | ||
line = lines[0] | ||
line = line[line.find('(') + 1:line.find(')')] | ||
return line |
File renamed without changes.
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