Created
August 8, 2019 10:00
-
-
Save b4ldr/b8ffac4d19b66a29a10bf285b00039aa to your computer and use it in GitHub Desktop.
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
hosts: | |
- database | |
- some_other_host |
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
hosts: | |
database: | |
default_address: 192.0.2.1 | |
some_other_host: | |
default_address: 192.0.2.2 |
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
$hosts = lookup(hosts) | |
$default_ip = '192.0.2.42' | |
$hosts.each |String $host| { | |
host{$host: | |
address => $facts.fetch('override_database_ip', $default_ip) | |
} | |
} |
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
# expanded example | |
$hosts = lookup(hosts) | |
$hosts.each |String $host, Hash $config| { | |
host{$host: | |
address => $facts.fetch('override_database_ip', $config['default_address']) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment