Last active
June 8, 2017 17:08
-
-
Save nrvale0/f07247585f655e14182d61b7cb68b4ba to your computer and use it in GitHub Desktop.
Quickly setup Consul cluster
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
$myaddr = $facts['networking']['interfaces']['eth0']['ip'] | |
notice("Configuring Consul to listen on ${myaddr}...") | |
file { '/var/hashicorp': | |
ensure => directory, | |
} | |
class { '::consul': | |
config_hash => { | |
bootstrap_expect => 4, | |
bind_addr => $myaddr, | |
log_level => 'INFO', | |
node_name => $::hostname, | |
server => true, | |
data_dir => '/var/hashicorp/consul', | |
ui_dir => '/var/hashicorp/consul/ui', | |
retry_join => [ '172.16.100.169', '54.149.223.140', '34.209.242.2', '54.200.58.222' ], | |
}, | |
} |
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
#!/bin/bash | |
set -eux | |
rpm -Uvh https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm | |
yum install -y puppet-agent | |
export PATH=/opt/puppetlabs/puppet/bin:$PATH | |
puppet service puppet ensure=stopped enable=false | |
puppet module install puppetlabs/stdlib | |
puppet module install KyleAnderson/consul | |
puppet module install lex/dnsmasq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment