Sha256: e0813afc68526600b942e32998560469a27b03788913b533a346eee0ad43e29c
Contents?: true
Size: 659 Bytes
Versions: 62
Compression:
Stored size: 659 Bytes
Contents
# frozen_string_literal: true module ForemanAnsible # imports ansible roles through UI class UiRolesImporter < RolesImporter def import! import_role_names end def finish_import(changes) return if changes.blank? create_new_roles changes['new'] if changes['new'] delete_old_roles changes['obsolete'] if changes['obsolete'] end def create_new_roles(changes) changes.each_pair do |_, new_role| ::AnsibleRole.create(new_role) end end def delete_old_roles(changes) changes.each_pair do |_, old_role| ::AnsibleRole.find(old_role['id']).destroy end end end end
Version data entries
62 entries across 62 versions & 1 rubygems