apache/manifests/init.pp
1 2 3 4 5 6 7 8 9 |
{ define vhost ($serveralias) { notify {"Creating $name with serveralias $serveralias.":; } } define redirect ($site, $to) { notify {"Adding redirect from $name to $to for $site":; } } } |
nginx/manifests/init.pp
1 2 3 4 5 6 7 8 9 |
{ define vhost ($serveralias) { notify {"Creating $name with serveralias $serveralias.":; } } define redirect ($site, $to) { notify {"Adding redirect from $name to $to for $site":; } } } |
http/manifests/init.pp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
{ search $httpdtype include webserver define site ($serveralias = false) { search $httpdtype webserver::vhost {"$name": serveralias => $serveralias, } } define redirect ($site, $to) { search $httpdtype webserver::redirect {"$name": site => $site, to => $to, } } } |
sites/manifests/init.pp
1 2 3 4 5 6 7 8 9 10 |
{ http::site {"www.example.com": serveralias => "example.com", } http::redirect {"/old-file": site => "www.example.com", to => "/new-file", } } |
First site.pp
1 2 3 4 5 6 |
|
First puppet output
1 2 3 4 5 |
notice: Adding redirect from /old-file to /new-file for www.example.com notice: //sites::example_com/Http::Redirect[/old-file]/Nginx::Webserver::Redirect[/old-file]/Notify[Adding redirect from /old-file to /new-file for www.example.com]/message: defined 'message' as 'Adding redirect from /old-file to /new-file for www.example.com' notice: Creating www.example.com with serveralias example.com. notice: //sites::example_com/Http::Site[www.example.com]/Nginx::Webserver::Vhost[www.example.com]/Notify[Creating www.example.com with serveralias example.com.]/message: defined 'message' as 'Creating www.example.com with serveralias example.com.' notice: Finished catalog run in 0.04 seconds |
Second site.pp
1 2 3 4 5 6 |
|
Second puppet output
1 2 3 4 5 |
notice: Adding redirect from /old-file to /new-file for www.example.com notice: //sites::example_com/Http::Redirect[/old-file]/Apache::Webserver::Redirect[/old-file]/Notify[Adding redirect from /old-file to /new-file for www.example.com]/message: defined 'message' as 'Adding redirect from /old-file to /new-file for www.example.com' notice: Creating www.example.com with serveralias example.com. notice: //sites::example_com/Http::Site[www.example.com]/Apache::Webserver::Vhost[www.example.com]/Notify[Creating www.example.com with serveralias example.com.]/message: defined 'message' as 'Creating www.example.com with serveralias example.com.' notice: Finished catalog run in 0.04 seconds |

