Sha256: 6c536e87008134df77de1e4bf4ed6d46ccac60e23ff71bf7c66a2febd3f414b4
Contents?: true
Size: 1.03 KB
Versions: 90
Compression:
Stored size: 1.03 KB
Contents
require 'itamae-mitsurin' module ItamaeMitsurin module Resource class Group < Base define_attribute :action, default: :create define_attribute :groupname, type: String, default_name: true define_attribute :gid, type: Integer def set_current_attributes current.exist = exist? if current.exist current.gid = run_specinfra(:get_group_gid, attributes.groupname).stdout.strip.to_i end end def action_create(options) if run_specinfra(:check_group_exists, attributes.groupname) if attributes.gid && attributes.gid != current.gid run_specinfra(:update_group_gid, attributes.groupname, attributes.gid) updated! end else options = { gid: attributes.gid, } run_specinfra(:add_group, attributes.groupname, options) updated! end end private def exist? run_specinfra(:check_group_exists, attributes.groupname) end end end end
Version data entries
90 entries across 47 versions & 1 rubygems