Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quietly ignores $file_template when $file_content is set #3

Open
DavidS opened this issue Jul 15, 2013 · 0 comments
Open

quietly ignores $file_template when $file_content is set #3

DavidS opened this issue Jul 15, 2013 · 0 comments

Comments

@DavidS
Copy link
Contributor

DavidS commented Jul 15, 2013

See https://github.com/stdmod/puppet-elasticsearch/blob/master/manifests/init.pp#L93:

if $file_content {
  $managed_file_content = $file_content
} else {
  if $file_template {
    $managed_file_content = template($file_template)
  } else {
    $managed_file_content = undef
  }
}

Using this pattern would lead to an explicit error:

  if $bind::config_path {
    file { 'named.conf':
      ensure  => $bind::config_ensure,
      path    => $bind::config_path,
      mode    => $bind::config_mode,
      owner   => $bind::config_owner,
      group   => $bind::config_group,
      source  => $bind::config_source,
    }

    if $config_content {
      File['named.conf'] {
        content => $config_content }
    }

    if $config_template {
      File['named.conf'] {
        content => template($config_template) }
    }
  }

The original would already error out if both source and content were specified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant