Skip to content

Instantly share code, notes, and snippets.

@dblessing
Created April 12, 2015 20:13
Show Gist options
  • Save dblessing/6666b56f0970adce0d0b to your computer and use it in GitHub Desktop.
Save dblessing/6666b56f0970adce0d0b to your computer and use it in GitHub Desktop.
Custom resource/provider w/ Poise
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