ssh-key-authorized

Description

n/a

Variables

Name Type Default Description

key

string --

The public key to add. Required

user

string --

The name of the user.

Code

args:
  user:
    doc:
      short_help: The name of the user.
    type: string
    required: false
    cli:
      param_decls:
      - --user
      - -u
  key:
    doc:
      short_help: The public key to add.
    type: string
    empty: false
    required: true
    cli:
      param_type: argument

frecklets:
- frecklet:
    name: ssh-keys-authorized.at.yml
    type: ansible-tasklist
    properties:
      idempotent: true
      elevated: '{{:: user | false_if_empty ::}}'
      internet: false
    desc:
      short: "add ssh key to authorized keys{%:: if user ::%}for user '{{:: user ::}}{%::\
        \ endif ::%}.'"
  vars:
    _become: '{{:: user | false_if_empty ::}}'
    _user: '{{:: user ::}}'
    _keys:
    - '{{:: key ::}}'
frecklecute ssh-key-authorized --help

Usage: frecklecute ssh-key-authorized [OPTIONS] KEY

  n/a

Options:
  -u, --user USER  The name of the user.
  --help           Show this message and exit.
# -*- coding: utf-8 -*-


#
# module path: pycklets.ssh_key_authorized.SshKeyAuthorized
#


from dataclasses import dataclass
from pyckles import AutoPycklet
from typing import *    # noqa

@dataclass
class SshKeyAuthorized(AutoPycklet):
    """No documentation available.

       Args:
         key: The public key to add.
         user: The name of the user.

    """

    FRECKLET_ID = "ssh-key-authorized"

    key: str = None
    user: str = None


    def __post_init__(self):
        super(SshKeyAuthorized, self).__init__(var_names=["key", "user"])


frecklet_class = SshKeyAuthorized
# -*- coding: utf-8 -*-


#
# module path: pycklets.ssh_key_authorized.SshKeyAuthorized
#


from pyckles import AutoPycklet

class SshKeyAuthorized(AutoPycklet):
    """No documentation available.

       Args:
         key: The public key to add.
         user: The name of the user.

    """

    FRECKLET_ID = "ssh-key-authorized"

    def __init__(self, key=None, user=None):

        super(SshKeyAuthorized, self).__init__(var_names=["key", "user"])
        self._key = key
        self._user = user

    @property
    def key(self):
        return self._key

    @key.setter
    def key(self, key):
        self._key = key

    @property
    def user(self):
        return self._user

    @user.setter
    def user(self, user):
        self._user = user



frecklet_class = SshKeyAuthorized