Skip to content

Commit

Permalink
Added support for templates
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmt committed Feb 2, 2012
1 parent 23de103 commit 2e7098c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions features/puppet.feature
Expand Up @@ -22,3 +22,8 @@ Scenario: Run puppet manifest with static files being served by fileserver
Given I have a clean running node n1
When I run puppet manifest "test_fileserver.pp" with config file "puppet_fileserver.conf" on node "n1"
Then Node "n1" should have file or directory "/tmp/puppet_test_fileserver"

Scenario: Run puppet manifest with template dir configuration
Given I have a clean running node n1
When I run puppet manifest "test_template.pp" with config file "puppet_template.conf" on node "n1"
Then Node "n1" should have file or directory "/tmp/puppet_test_template"
8 changes: 8 additions & 0 deletions fixtures/puppet/conf/puppet_template.conf
@@ -0,0 +1,8 @@
[main]
templatedir = /tmp/toft-puppet-tmp/manifests/templates

logdir = /var/log/puppet
vardir = /var/lib/puppet
ssldir = /var/lib/puppet/ssl
rundir = /var/run/puppet
report = true
2 changes: 2 additions & 0 deletions fixtures/puppet/manifests/templates/template_test
@@ -0,0 +1,2 @@
This is a test for the template config
Here is the variable <%= variable %>
12 changes: 12 additions & 0 deletions fixtures/puppet/manifests/test_template.pp
@@ -0,0 +1,12 @@
class { 'test': }

class test {

$variable = "BLAH"

file { "/tmp/puppet_test_template":
ensure => present,
mode => '0666',
content => template(template_test)
}
}

0 comments on commit 2e7098c

Please sign in to comment.