From 1dac8d0e57d475651c3cc703781ac59dfee08dcb Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Mon, 2 Dec 2013 16:51:56 -0500 Subject: [PATCH] Show some various file stuff --- files/test2.txt | 1 + manifests/2-file-type.pp | 18 ++++++++++++++++++ templates/test3.txt.erb | 1 + 3 files changed, 20 insertions(+) create mode 100644 files/test2.txt create mode 100644 manifests/2-file-type.pp create mode 100644 templates/test3.txt.erb diff --git a/files/test2.txt b/files/test2.txt new file mode 100644 index 0000000..eafd568 --- /dev/null +++ b/files/test2.txt @@ -0,0 +1 @@ +We can create a file from another diff --git a/manifests/2-file-type.pp b/manifests/2-file-type.pp new file mode 100644 index 0000000..ffce810 --- /dev/null +++ b/manifests/2-file-type.pp @@ -0,0 +1,18 @@ +# create file simple file +file { '/tmp/test1.txt': + ensure => present, + content => 'Hello', +} + +# create file from existing file +file { '/tmp/test2.txt': + ensure => present, + source => '/vagrant/files/test2.txt', +} + +# create file from template +$something = "Hello" +file { '/tmp/test3.txt': + ensure => present, + content => template('/vagrant/templates/test3.txt.erb'), +} diff --git a/templates/test3.txt.erb b/templates/test3.txt.erb new file mode 100644 index 0000000..5faaf8e --- /dev/null +++ b/templates/test3.txt.erb @@ -0,0 +1 @@ +You said: <%= @something %>