Skip to content

Instantly share code, notes, and snippets.

@KitaitiMakoto
Created January 7, 2016 06:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KitaitiMakoto/ec3632bcf4a695cc79c4 to your computer and use it in GitHub Desktop.
Save KitaitiMakoto/ec3632bcf4a695cc79c4 to your computer and use it in GitHub Desktop.
module Itamae
module Resource
class SecurityContext < Base
define_attribute :action, default: :nothing
define_attribute :path, type: [String], default_name: true
define_attribute :recursive, type: [TrueClass, FalseClass], default: false
def action_restore(options)
cmd = ['restorecon', attributes.path]
cmd << '-R' if attributes.recursive
run_command cmd
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment