Skip to content

Latest commit

 

History

History
229 lines (130 loc) · 4.5 KB

File metadata and controls

229 lines (130 loc) · 4.5 KB

Reference

Table of Contents

Classes

  • pubkey: Common configuration

Defined types

Public Defined types

  • pubkey::ssh: Generate ssh key pair and exports public ssh key

Private Defined types

  • pubkey::keygen: Internal class to validate detected parameters

Data types

Classes

pubkey

Common configuration

Examples

include pubkey

Parameters

The following parameters are available in the pubkey class:

cache_owner

Data type: String

Owner of the cache directory

cache_group

Data type: String

Group of the cache directory

export_keys

Data type: Boolean

Whether manage directory for exported keys. Note in order to disable pubkey::ssh::export_key should be set to false on each key.

Defined types

pubkey::ssh

Exports public ssh key to Puppetserver

Examples

pubkey::ssh { 'john_rsa': }
pubkey::ssh { 'johndoe':
  type    => 'ed25519',
  comment => 'johndoe_ed25519',
  tags    => ['users'],
}
pubkey::ssh { 'bob_ed25519':
  user        => 'bob', # auto-detected from title
  target_user => 'deploy', # user account under which authorized key will be stored
  tags        => ['users'],
}

Parameters

The following parameters are available in the pubkey::ssh defined type:

generate

Data type: Boolean

Whether missing key should be generated

Default value: true

user

Data type: Optional[String[1]]

account name where ssh key is (optionally) generated and public key stored into exported resource

Default value: undef

target_user

Data type: Optional[String[1]]

account name under which we will store the authorized key (by default same as user)

Default value: undef

type

Data type: Optional[Pubkey::Type]

ssh key type one of: 'dsa', 'rsa', 'ecdsa', 'ed25519', 'ecdsa-sk', 'ed25519-sk'

Default value: undef

home

Data type: Optional[Stdlib::UnixPath]

user's home directory, assuming .ssh is located in $HOME/.ssh

Default value: undef

prefix

Data type: Optional[String[1]]

custom key file prefix for the ssh key file (default: 'id')

Default value: undef

comment

Data type: Optional[String[1]]

ssh key's comment

Default value: undef

size

Data type: Optional[Integer]

number of bits for generated ssh key

Default value: undef

tags

Data type: Optional[Array[String]]

optional tags added to the exported key

Default value: undef

export_key

Data type: Boolean

whether export the generated key (default: true)

Default value: true

path

Data type: Stdlib::AbsolutePath

standard unix path to look for ssh-keygen

Default value: $facts['path']

hostname

Data type: String

that will be part of exported resource

Default value: $facts['networking']['fqdn']

separator

Data type: String[1]

A character for user and type auto-detection (default: '_')

Default value: '_'

Data types

Pubkey::Type

Supported ssh key types

Alias of Enum['dsa', 'rsa', 'ecdsa', 'ed25519', 'ecdsa-sk', 'ed25519-sk']