Sha256: eae05bf96354116dbf0058a02f15762b782cf72b499493c2dd663505ae2f71e8

Contents?: true

Size: 1.23 KB

Versions: 14

Compression:

Stored size: 1.23 KB

Contents

# frozen_string_literal: true

require 'rake_factory'
require 'ruby_easy_rsa'

require_relative '../../mixins/global_parameters'
require_relative '../../mixins/ssl_parameters'
require_relative '../../mixins/algorithm_parameters'
require_relative '../../mixins/encrypt_key_parameters'
require_relative '../../mixins/easy_rsa_ensure_prerequisite'

module RakeEasyRSA
  module Tasks
    module Server
      class Create < RakeFactory::Task
        include Mixins::GlobalParameters
        include Mixins::SSLParameters
        include Mixins::AlgorithmParameters
        include Mixins::EncryptKeyParameters
        include Mixins::EasyRSAEnsurePrerequisite

        parameter :default_argument_names, default: [:filename_base]
        parameter :vegetable

        default_name :create
        default_description 'Create a server certificate for the PKI'

        def argument_names
          @argument_names + default_argument_names
        end

        action do |t, args|
          puts "Creating server certificate '#{args.filename_base}'... "
          RubyEasyRSA.build_server_full(
            t.parameter_values.merge(
              filename_base: args.filename_base
            )
          )
          puts 'Done.'
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rake_easy_rsa-0.16.0.pre.2 lib/rake_easy_rsa/tasks/server/create.rb
rake_easy_rsa-0.16.0.pre.1 lib/rake_easy_rsa/tasks/server/create.rb
rake_easy_rsa-0.15.0 lib/rake_easy_rsa/tasks/server/create.rb
rake_easy_rsa-0.14.0.pre.7 lib/rake_easy_rsa/tasks/server/create.rb
rake_easy_rsa-0.14.0.pre.6 lib/rake_easy_rsa/tasks/server/create.rb
rake_easy_rsa-0.14.0.pre.5 lib/rake_easy_rsa/tasks/server/create.rb
rake_easy_rsa-0.14.0.pre.4 lib/rake_easy_rsa/tasks/server/create.rb
rake_easy_rsa-0.14.0.pre.3 lib/rake_easy_rsa/tasks/server/create.rb
rake_easy_rsa-0.14.0.pre.2 lib/rake_easy_rsa/tasks/server/create.rb
rake_easy_rsa-0.14.0.pre.1 lib/rake_easy_rsa/tasks/server/create.rb
rake_easy_rsa-0.13.0 lib/rake_easy_rsa/tasks/server/create.rb
rake_easy_rsa-0.12.0.pre.4 lib/rake_easy_rsa/tasks/server/create.rb
rake_easy_rsa-0.12.0.pre.3 lib/rake_easy_rsa/tasks/server/create.rb
rake_easy_rsa-0.12.0.pre.2 lib/rake_easy_rsa/tasks/server/create.rb