Skip to content
This repository has been archived by the owner on Sep 13, 2018. It is now read-only.

enable band / panels plugin for puppet #78

Merged
merged 1 commit into from
May 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions manifests/plugin_bands.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# TODO: probably should move this file into its own puppet module
# TODO: need to make config handling more generic, this should work with ANY plugin

class uber::plugin_bands (
$git_repo = "https://github.com/magfest/bands",
$git_branch = "master",
$stage_agreement_deadline = undef,
) {
uber::repo { "${uber::plugins_dir}/bands":
source => $git_repo,
revision => $git_branch,
require => File["${uber::plugins_dir}"],
}

file { "${uber::plugins_dir}/bands/development.ini":
ensure => present,
mode => 660,
content => template('uber/bands-development.ini.erb'),
require => [ Uber::Repo["${uber::plugins_dir}/bands"] ],
}
}
25 changes: 25 additions & 0 deletions manifests/plugin_panels.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# TODO: probably should move this file into its own puppet module
# TODO: need to make config handling more generic, this should work with ANY plugin

class uber::plugin_panels (
$git_repo = "https://github.com/magfest/panels",
$git_branch = "master",
$hide_schedule = true,
$expected_response = undef,
$event_location = undef,
$panel_rooms = undef,
$panel_app_deadline = undef,
) {
uber::repo { "${uber::plugins_dir}/panels":
source => $git_repo,
revision => $git_branch,
require => File["${uber::plugins_dir}"],
}

file { "${uber::plugins_dir}/panels/development.ini":
ensure => present,
mode => 660,
content => template('uber/panels-development.ini.erb'),
require => [ Uber::Repo["${uber::plugins_dir}/panels"] ],
}
}
9 changes: 9 additions & 0 deletions templates/bands-development.ini.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# THIS FILE IS GENERATED BY PUPPET
# DO NOT EDIT DIRECTLY, INSTEAD EDIT THE .erb template



[dates]
<% if @stage_agreement_deadline %>
stage_agreement_deadline = <%= @stage_agreement_deadline %>
<% end -%>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's a lot more to add here to get this working, but it's a good starting point

23 changes: 23 additions & 0 deletions templates/panels-development.ini.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# THIS FILE IS GENERATED BY PUPPET
# DO NOT EDIT DIRECTLY, INSTEAD EDIT THE .erb template

<% if @hide_schedule %>
hide_schedule = <%= @hide_schedule %>
<% end -%>

<% if @expected_response %>
expected_response = "<%= @expected_response %>"
<% end -%>

<% if @event_location %>
event_location = "<%= @event_location %>"
<% end -%>

<% if @panel_rooms %>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this work as intended? Keeping in mind that, according to a quick Google search, our empty list is not considered falsey in Ruby.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, it ends up generating the following line in the INI file because our empty list is truthy in ruby:

puppet config for magstock says:

uber::plugin_panels::panel_rooms: ","

INI looks like:

panel_rooms = ,

If puppet doesn't specify anything, puppet's deftault is 'undef' which means that the configspec.ini value for panel_rooms of "panels_1", "panels_2", "panels_3", "panels_4" will be used instead.

panel_rooms = <%= @panel_rooms %>
<% end -%>

<% if @panel_app_deadline %>
[dates]
panel_app_deadline = "<%= @panel_app_deadline %>"
<% end -%>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same deal, there's a lot more to add here to get this working, but it's a good starting point