Commit 86ad33ff authored by Nathan Ward's avatar Nathan Ward
Browse files

Set ensure_newline for concats, and remove explicit newlines in concat fragments

parent 7338d283
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ define freeradius::dictionary (
  if ($ensure == 'present') {
    concat::fragment { "dictionary.${name}":
      target  => "${fr_basepath}/dictionary",
      content => "\$INCLUDE ${fr_basepath}/dictionary.d/dictionary.${name}\n",
      content => "\$INCLUDE ${fr_basepath}/dictionary.d/dictionary.${name}",
      order   => $order,
      require => File["${fr_basepath}/dictionary.d/dictionary.${name}"],
    }
+37 −31
Original line number Diff line number Diff line
@@ -150,6 +150,7 @@ class freeradius (
    owner          => 'root',
    group          => $freeradius::fr_group,
    mode           => '0640',
    ensure_newline => true,
    require        => [Package[$freeradius::fr_package], Group[$freeradius::fr_group]],
    notify         => Service[$freeradius::fr_service],
  }
@@ -169,6 +170,7 @@ class freeradius (
    owner          => 'root',
    group          => $freeradius::fr_group,
    mode           => '0640',
    ensure_newline => true,
    require        => [Package[$freeradius::fr_package], Group[$freeradius::fr_group]],
    notify         => Service[$freeradius::fr_service],
  }
@@ -189,12 +191,13 @@ class freeradius (
    owner          => 'root',
    group          => $freeradius::fr_group,
    mode           => '0640',
    ensure_newline => true,
    require        => [Package[$freeradius::fr_package], Group[$freeradius::fr_group]],
    notify         => Service[$freeradius::fr_service],
  }
  concat::fragment { 'proxy_header':
    target  => "${freeradius::fr_basepath}/proxy.conf",
    content => "# Proxy config\n",
    content => '# Proxy config',
    order   => '05',
  }

@@ -203,6 +206,7 @@ class freeradius (
    owner          => 'root',
    group          => $freeradius::fr_group,
    mode           => '0640',
    ensure_newline => true,
    require        => [Package[$freeradius::fr_package], Group[$freeradius::fr_group]],
    notify         => Service[$freeradius::fr_service],
  }
@@ -241,6 +245,7 @@ class freeradius (
    owner          => 'root',
    group          => $freeradius::fr_group,
    mode           => '0644',
    ensure_newline => true,
    require        => [Package[$freeradius::fr_package], Group[$freeradius::fr_group]],
  }
  concat::fragment { 'dictionary_header':
@@ -259,6 +264,7 @@ class freeradius (
    owner          => 'root',
    group          => $freeradius::fr_group,
    mode           => '0640',
    ensure_newline => true,
    require        => [Package[$freeradius::fr_package], Group[$freeradius::fr_group]],
    notify         => Service[$freeradius::fr_service],
  }
@@ -454,7 +460,7 @@ class freeradius (
    "${freeradius::fr_basepath}/clients.conf",
    "${freeradius::fr_basepath}/sql.conf",
  ]:
    content => "# FILE INTENTIONALLY BLANK\n",
    content => '# FILE INTENTIONALLY BLANK',
    mode    => '0644',
    owner   => 'root',
    group   => $freeradius::fr_group,
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ define freeradius::policy (
  if ($ensure == 'present') {
    concat::fragment { "policy-${name}":
      target  => "${fr_basepath}/policy.conf",
      content => "\t\$INCLUDE ${fr_basepath}/policy.d/${name}\n",
      content => "\t\$INCLUDE ${fr_basepath}/policy.d/${name}",
      order   => $order,
      require => File["${fr_basepath}/policy.d/${name}"],
    }
+21 −17
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ describe 'freeradius' do
            'mode'           => '0640',
            'notify'         => 'Service[radiusd]',
            'owner'          => 'root',
            'ensure_newline' => true,
          )
          .that_requires('Package[freeradius]')
          .that_requires('Group[radiusd]')
@@ -113,6 +114,7 @@ describe 'freeradius' do
            'mode'           => '0640',
            'notify'         => 'Service[radiusd]',
            'owner'          => 'root',
            'ensure_newline' => true,
          )
          .that_requires('Package[freeradius]')
          .that_requires('Group[radiusd]')
@@ -121,7 +123,7 @@ describe 'freeradius' do
      it do
        is_expected.to contain_concat__fragment('proxy_header')
          .with(
            'content' => "# Proxy config\n",
            'content' => '# Proxy config',
            'order'   => '05',
            'target'  => '/etc/raddb/proxy.conf',
          )
@@ -134,6 +136,7 @@ describe 'freeradius' do
            'mode'           => '0640',
            'notify'         => 'Service[radiusd]',
            'owner'          => 'root',
            'ensure_newline' => true,
          )
          .that_requires('Package[freeradius]')
          .that_requires('Group[radiusd]')
@@ -153,6 +156,7 @@ describe 'freeradius' do
            'group'          => 'radiusd',
            'mode'           => '0644',
            'owner'          => 'root',
            'ensure_newline' => true,
          )
          .that_requires('Package[freeradius]')
          .that_requires('Group[radiusd]')
@@ -364,7 +368,7 @@ describe 'freeradius' do
        ].each do |file|
          is_expected.to contain_file(file)
            .with(
              'content' => "# FILE INTENTIONALLY BLANK\n",
              'content' => '# FILE INTENTIONALLY BLANK',
              'group'   => 'radiusd',
              'mode'    => '0644',
              'notify'  => 'Service[radiusd]',
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ describe 'freeradius::policy' do

  it do
    is_expected.to contain_concat__fragment('policy-test')
      .with_content(%r{\s+\$INCLUDE /etc/raddb/policy.d/test\n})
      .with_content(%r{\s+\$INCLUDE /etc/raddb/policy.d/test$})
      .with_order('50')
      .with_target('/etc/raddb/policy.conf')
      .that_requires('File[/etc/raddb/policy.d/test]')