Configset Helper: content_file

The content_file helper reads the file in the configsets lib/content folder and returns it as a String. This helps you organized things and keep the file method readable.

Example

lib/files/script.sh:

#!/bin/bash
echo hello

lib/configset.rb:

file("/tmp/myfile2.txt",
  content: content_file("script.sh"), # uses lib/files/script.sh
  mode: "120644",
)

Edit this page

See a typo or an error? You can improve this page. This website is available on GitHub and contributions are encouraged and welcomed. We love pull requests from you!