Skip to content

quietly ignores $file_template when $file_content is set #3

@DavidS

Description

@DavidS

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions