require "exceptions/bootstrap_error"
require "exceptions/deploy_error"
require "hooks"

module Devops
  module Model
    module ConfigurationManagement
      class Tool

        include Hooks
        attr_accessor :name

        #params:
        #  out - container for output data
        #  deploy_info - hash with deploy data
        define_hook :before_deploy
        define_hook :after_deploy

        #params:
        #  out - container for output data
        define_hook :before_bootstrap
        define_hook :after_bootstrap

        def to_hash
          {
            "name" => self.name
          }
        end

        def check_node_name name
          raise "override me"
        end

        def bootstrap_instance server, out
          raise "override me"
        end

        def deploy_instance server, deploy_info, out
          raise "override me"
        end

      end
    end
  end
end
