register-var

Example:

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

Description

Registers the content of an (internal) Ansible variable.

Variables

Name Type Default Description

register_name

string --

n/a Required

var_name

string --

The Ansible variable name to debug Required

Examples

Example 1

Display the currents user home directory.

Code
- register-var:
    var: ansible_env.HOME

Code

doc:
  short_help: Registers the content of an (internal) Ansible variable.
  examples:
  - title: Display the currents user home directory.
    vars:
      var: ansible_env.HOME

args:
  register_name:
    doc:
      short_name: The name to store the value of the variable under.
    type: string
    required: true
  var_name:
    type: string
    required: true
    doc:
      short_help: The Ansible variable name to debug

meta:
  tags:
  - debug

frecklets:
- frecklet:
    type: ansible-tasklist
    name: register-var.at.yml
#      register: "{{:: register_name ::}}"
    resources:
      ansible-tasklist: register-var.at.yml
    desc:
      short: "register value of var '{{:: var_name ::}}' under '{{:: register_name\
        \ ::}}"
    properties:
      idempotent: false
      become: false
      internet: false
  vars:
    var_value: '{{ {{:: var_name ::}} }}'
    register_name: '{{:: register_name ::}}'
frecklecute register-var --help

Usage: frecklecute register-var [OPTIONS]

  Registers the content of an (internal) Ansible variable.

Options:
  --register-name REGISTER_NAME  n/a  [required]
  --var-name VAR_NAME            The Ansible variable name to debug
                                 [required]
  --help                         Show this message and exit.
# -*- coding: utf-8 -*-


#
# module path: pycklets.register_var.RegisterVar
#


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

@dataclass
class RegisterVar(AutoPycklet):
    """Registers the content of an (internal) Ansible variable.

       Args:
         register_name: n/a
         var_name: The Ansible variable name to debug

    """

    FRECKLET_ID = "register-var"

    register_name: str = None
    var_name: str = None


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


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


#
# module path: pycklets.register_var.RegisterVar
#


from pyckles import AutoPycklet

class RegisterVar(AutoPycklet):
    """Registers the content of an (internal) Ansible variable.

       Args:
         register_name: n/a
         var_name: The Ansible variable name to debug

    """

    FRECKLET_ID = "register-var"

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

        super(RegisterVar, self).__init__(var_names=["register_name", "var_name"])
        self._register_name = register_name
        self._var_name = var_name

    @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 var_name(self):
        return self._var_name

    @var_name.setter
    def var_name(self, var_name):
        self._var_name = var_name



frecklet_class = RegisterVar