class Itamae::Resource::Group

Public Instance Methods

action_create(options) click to toggle source
# File lib/itamae/resource/group.rb, line 16
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
set_current_attributes() click to toggle source
# File lib/itamae/resource/group.rb, line 8
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

Private Instance Methods

exist?() click to toggle source
# File lib/itamae/resource/group.rb, line 34
def exist?
  run_specinfra(:check_group_exists, attributes.groupname)
end