Unverified Commit c4c94a4f authored by Jonathan's avatar Jonathan Committed by GitHub
Browse files

Merge pull request #114 from treydock/fix-exec-order

Fix order of Exec to come after adding certs directory
parents 04743eeb 2439b8fa
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
---
BUNDLE_DISABLE_SHARED_GEMS: '1'
+2 −0
Original line number Diff line number Diff line
@@ -406,6 +406,7 @@ class freeradius (
    command => "openssl dhparam -out ${freeradius::fr_basepath}/certs/dh 1024",
    creates => "${freeradius::fr_basepath}/certs/dh",
    path    => '/usr/bin',
    require => File["${freeradius::fr_basepath}/certs"],
  }

  # Generate global SSL parameters
@@ -413,6 +414,7 @@ class freeradius (
    command => "dd if=/dev/urandom of=${freeradius::fr_basepath}/certs/random count=10 >/dev/null 2>&1",
    creates => "${freeradius::fr_basepath}/certs/random",
    path    => '/bin',
    require => File["${freeradius::fr_basepath}/certs"],
  }

  # This exec tests the radius config and fails if it's bad
+6 −4
Original line number Diff line number Diff line
@@ -278,7 +278,8 @@ describe 'freeradius' do
      .with(
        'command' => 'openssl dhparam -out $freeradius::fr_basepath/certs/dh 1024',
        'creates' => '$freeradius::fr_basepath/certs/dh',
        'path'    => '/usr/bin'
        'path'    => '/usr/bin',
        'require' => 'File[$freeradius::fr_basepath/certs]'
      )
  end
  it do
@@ -286,13 +287,14 @@ describe 'freeradius' do
      .with(
        'command' => 'dd if=/dev/urandom of=$freeradius::fr_basepath/certs/random count=10 >/dev/null 2>&1',
        'creates' => '$freeradius::fr_basepath/certs/random',
        'path'    => '/bin'
        'path'    => '/bin',
        'require' => 'File[$freeradius::fr_basepath/certs]'
      )
  end
  it do
    is_expected.to contain_exec('radiusd-config-test')
      .with(
        'command'     => 'sudo radiusd -XC | grep 'Configuration appears to be OK.' | wc -l',
        'command'     => 'sudo radiusd -XC | grep \'Configuration appears to be OK.\' | wc -l',
        'logoutput'   => 'on_failure',
        'path'        => '[/bin/, /sbin/, /usr/bin/, /usr/sbin/]',
        'refreshonly' => 'true',
@@ -350,7 +352,7 @@ describe 'freeradius' do
  it do
    is_expected.to contain_syslog__rule('radiusd-log')
      .with(
        'command' => 'if $programname == 'radiusd' then $freeradius::fr_logpath/radius.log\\n&~',
        'command' => 'if $programname == \'radiusd\' then $freeradius::fr_logpath/radius.log\\n&~',
        'order'   => '12'
      )
  end