Sha256: a499508af054d00a735fe12b41c606ed752d20570f5d159d5dc9dba4608df403
Contents?: true
Size: 550 Bytes
Versions: 5
Compression:
Stored size: 550 Bytes
Contents
module ForemanAnsible # imports Ansible roles through API class ApiRolesImporter < RolesImporter def import!(role_names = nil) new_roles = import_role_names[:new] if role_names.present? new_roles.select! do |role| role_names.include?(role.name) end end new_roles.map(&:save) new_roles end def obsolete! obsolete_roles = import_role_names[:obsolete] obsolete_roles.map(&:destroy) obsolete_roles end def fetch! fetch_role_names end end end
Version data entries
5 entries across 5 versions & 1 rubygems