Created
April 12, 2015 20:13
-
-
Save dblessing/6666b56f0970adce0d0b to your computer and use it in GitHub Desktop.
Custom resource/provider w/ Poise
This file contains hidden or 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
class Chef | |
class Resource::GitlabOmnibusPackage < Resource::Package | |
include Poise | |
provides :gitlab_omnibus_package | |
attribute :backup, kind_of: [TrueClass, FalseClass], default: true | |
# Was previously working without poise w/ follow: | |
# def initialize(name, run_context=nil) | |
# super | |
# @backup = true | |
# @resource_name = :gitlab_omnibus_package | |
# end | |
# def backup(arg=nil) | |
# set_or_return( | |
# :backup, | |
# arg, | |
# :kind_of => [ TrueClass, FalseClass ] | |
# ) | |
# end | |
end | |
class Provider::GitlabOmnibusPackage < Provider::Package::Yum | |
require 'chef/mixin/shell_out' | |
include Poise | |
provides :gitlab_omnibus_package, os: 'linux', platform_family: ['rhel', 'fedora'] | |
def action_upgrade | |
Chef::Log.info("Upgrading via gitlab_omnibus_package") | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment