Sha256: 167da99c2c57fc462a43d6b58d4277e8624e18e2b48d1e1e7c1b2f8d5a2f180a
Contents?: true
Size: 581 Bytes
Versions: 39
Compression:
Stored size: 581 Bytes
Contents
# frozen_string_literal: true 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
39 entries across 39 versions & 1 rubygems