Skip to content

Commit

Permalink
Remove join wan
Browse files Browse the repository at this point in the history
  • Loading branch information
RiANOl committed Dec 1, 2016
1 parent 1b0a1ee commit f1e9df5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 27 deletions.
1 change: 0 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
$extra_groups = [],
$purge_config_dir = true,
$group = 'nomad',
$join_wan = false,
$bin_dir = '/usr/local/bin',
$arch = $nomad::params::arch,
$version = $nomad::params::version,
Expand Down
25 changes: 10 additions & 15 deletions manifests/run_service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,22 @@
#
class nomad::run_service {

$init_selector = $nomad::init_style ? {
$init_selector = $::nomad::init_style ? {
'launchd' => 'io.nomad.daemon',
default => 'nomad',
}

if $nomad::manage_service == true {
service { 'nomad':
ensure => $nomad::service_ensure,
name => $init_selector,
enable => $nomad::service_enable,
provider => $nomad::init_style,
}
$service_provider = $::nomad::init_style ? {
'unmanaged' => undef,
default => $::nomad::init_style,
}

if $nomad::join_wan {
exec { 'join nomad wan':
cwd => $nomad::config_dir,
path => [$nomad::bin_dir,'/bin','/usr/bin'],
command => "nomad join -wan ${nomad::join_wan}",
unless => "nomad members -wan -detailed | grep -vP \"dc=${nomad::config_hash_real['datacenter']}\" | grep -P 'alive'",
subscribe => Service['nomad'],
if $::nomad::manage_service == true {
service { 'nomad':
ensure => $::nomad::service_ensure,
name => $init_selector,
enable => $::nomad::service_enable,
provider => $service_provider,
}
}

Expand Down
11 changes: 0 additions & 11 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,6 @@
it { should_not contain_class('nomad::config').that_notifies(['Class[nomad::run_service]']) }
end

context 'When joining nomad to a wan cluster by a known URL' do
let(:params) {{
:join_wan => 'wan_host.test.com'
}}
it { should contain_exec('join nomad wan').with(:command => 'nomad join -wan wan_host.test.com') }
end

context 'By default, should not attempt to join a wan cluster' do
it { should_not contain_exec('join nomad wan') }
end

context 'When requesting to install via a package with defaults' do
let(:params) {{
:install_method => 'package'
Expand Down

0 comments on commit f1e9df5

Please sign in to comment.