Created
January 7, 2016 06:26
-
-
Save KitaitiMakoto/ec3632bcf4a695cc79c4 to your computer and use it in GitHub Desktop.
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
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
See https://github.com/KitaitiMakoto/itamae-plugin-resource-security_context