diff options
author | Hugo Hörnquist <hugo@hornquist.se> | 2021-06-29 22:29:16 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@hornquist.se> | 2021-06-29 22:29:16 +0200 |
commit | f64cf60c26ec55af4bf71c4f43f59eaf1e2470b0 (patch) | |
tree | 6034fe898948d7d48fe0ccc03cf1a13b9cc7b583 /manifests | |
download | website_blog_2-f64cf60c26ec55af4bf71c4f43f59eaf1e2470b0.tar.gz website_blog_2-f64cf60c26ec55af4bf71c4f43f59eaf1e2470b0.tar.xz |
Blog working.
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/init.pp | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000..a639311 --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,78 @@ +define blog ( + String $root, +) { + vcsrepo { $root: + ensure => latest, + provider => git, + source => 'https://github.com/HugoNikanor/website-blog-2.git', + revision => 'master', + # keep_local_changes => true, + owner => 'hugo', + group => 'www-data', + } + + vcsrepo { "${root}/entries": + ensure => latest, + provider => git, + source => '/home/git/git/blog-entries.git', + revision => 'master', + owner => 'hugo', + group => 'www-data', + } + + file { "${root}/settings.php": + ensure => file, + content => @(EOF) + <?php + # FILE MANAGED BY PUPPET + $author = "Hugo Hornquist"; + $blog_title = "HugoNikanors blogg‽"; + $blog_subtitle = "A blog about nothing, but mostly itself."; + $http_host = $_SERVER["HTTP_HOST"]; + $urlbase = "http://$http_host/hugo"; + $has_comments = false; + | EOF + } + + file { "${root}/footnote": + ensure => directory, + recurse => true, + } + + $foot_files = [ + ['about.md', 'About'], + ['contact.md', 'Contact'], + ['legal.md', 'Legal'], + ['qna.md', '"Q&A"'], + ] + + $foot_files.each |$item| { + file { "${root}/footnote/${item[0]}": + source => "puppet:///modules/blog/footers/${item[0]}", + } + } + + + $files_ini = join($foot_files.map |$item| { + @("EOF") + files[] = ${item[0]} + title[] = ${item[1]} + | EOF + }) + + file { "${root}/special-files.ini": + ensure => file, + content => @("EOF") + ; FILE MANAGED BY PUPPET + ; + ; Which files on the website that are "special" + ; This basicly means that they shouldn't have comments + [footnote] + ${files_ini} + + [other] + files[] = list + files[] = entry-not-found.md + | EOF + } +} |