Last active
January 9, 2017 04:21
-
-
Save thommay/a8e620bb84c9acc648bc4cff691a23d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource_name :email_alias | |
property :address | |
property :recipients, Array | |
default_action :create | |
action :create do | |
with_run_context :root do | |
edit_resource(:template, "/tmp/aliases") do |new_resource| | |
source 'aliases.erb' | |
variables[:aliases] ||= {} | |
variables[:aliases][new_resource.address] ||= [] | |
variables[:aliases][new_resource.address] += new_resource.recipients | |
action :nothing | |
delayed_action :create | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
email_alias "thom" do | |
address "thom" | |
recipients %w{ foo bar baz } | |
end | |
email_alias "test" do | |
address "test" | |
recipients %w{ cat bodge baz } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment