register-home-dir

Example:

# Display the currents user home directory.
- register-home-dir:
    var: ansible_env.HOME

Description

The user has to exist already on the target.

Variables

Name Type Default Description

register_name

string --

n/a Required

user

string --

The name of the user. Required

Examples

Example 1

Display the currents user home directory.

Code
- register-home-dir:
    var: ansible_env.HOME

Code

doc:
  short_help: Registers the home directory of a user on the target system.
  help: |
    The user has to exist already on the target.
  examples:
  - title: Display the currents user home directory.
    vars:
      var: ansible_env.HOME

args:
  _import:
  - register-var
  user:
    type: string
    required: true
    doc:
      short_help: The name of the user.

meta:
  tags:
  - debug

frecklets:
- frecklet:
    type: ansible-tasklist
    name: set-user-home-dir-var.at.yml
#      register: "{{:: register_name ::}}"
    resources:
      ansible-tasklist: set-user-home-dir-var.at.yml
    desc:
      short: "get home directory for user '{{:: user ::}}'"
    properties:
      idempotent: false
      become: false
      internet: false
  vars:
    __user_name__: '{{:: user ::}}'
    __target_var_name__: __temp_register_name__
- register-var:
    register_name: '{{:: register_name ::}}'
    var_name: __temp_register_name__
frecklecute register-home-dir --help

Usage: frecklecute register-home-dir [OPTIONS]

  The user has to exist already on the target.

Options:
  --register-name REGISTER_NAME  n/a  [required]
  --user USER                    The name of the user.  [required]
  --help                         Show this message and exit.
# -*- coding: utf-8 -*-


#
# module path: pycklets.register_home_dir.RegisterHomeDir
#


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

@dataclass
class RegisterHomeDir(AutoPycklet):
    """The user has to exist already on the target.

       Args:
         register_name: n/a
         user: The name of the user.

    """

    FRECKLET_ID = "register-home-dir"

    register_name: str = None
    user: str = None


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


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


#
# module path: pycklets.register_home_dir.RegisterHomeDir
#


from pyckles import AutoPycklet

class RegisterHomeDir(AutoPycklet):
    """The user has to exist already on the target.

       Args:
         register_name: n/a
         user: The name of the user.

    """

    FRECKLET_ID = "register-home-dir"

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

        super(RegisterHomeDir, self).__init__(var_names=["register_name", "user"])
        self._register_name = register_name
        self._user = user

    @property
    def register_name(self):
        return self._register_name

    @register_name.setter
    def register_name(self, register_name):
        self._register_name = register_name

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

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



frecklet_class = RegisterHomeDir