Skip to content

Conversation

josegonzalez
Copy link

@josegonzalez josegonzalez commented Aug 22, 2024

Description

When distributing a pack, it is common to wish to ship larger config files as part of a pack in separate files. This allows for better readability, as well as ensuring users can fallback on syntax highlighting from their editors when working on those files.

Reminders

  • Add CHANGELOG.md entry

Usage:

      template {
        data        = <<EOF
[[ fileContents (list (packPath) "templates/configs" "file-name.txt" | join "/") ]]
EOF
        destination = "${NOMAD_TASK_DIR}/file-name.txt"
      }

@josegonzalez josegonzalez changed the title feat: add template function for reading files from the pack templates directory Add template function for reading files from the pack templates directory Aug 22, 2024
@josegonzalez josegonzalez changed the title Add template function for reading files from the pack templates directory Add template function for returning the path to the pack's directory Aug 22, 2024
@josegonzalez josegonzalez force-pushed the pack-filecontents branch 2 times, most recently from ff2de47 to 2fa2ba7 Compare August 22, 2024 00:42
…ctory

This allows users to read the fileContents of files within the pack folder, making templating out larger files less inconvenient and allowing users to use syntax highting from their editors when working on said files.
@josegonzalez
Copy link
Author

Is there anything I need to do to get this merged?

@aleksanderllada
Copy link

This would be super useful for us too! Currently there's no way to inject configuration files without writing them directly inside a template block.

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

Successfully merging this pull request may close these issues.

3 participants