ansible-tasklist

Description

This is a generic task to execute an Ansible tasklist

Currently only a few basic metadata keys are supported: include_type, become &become_user. The other ones will be added when necessary.

Be aware, if the tasklist is not in the default or community resources repository, this will only work if 'allow_remote' or 'allow_remote_tasklists' is set to true in the context that is used.

Variables

Name Type Default Description

name

string --

The role name. Required

become

boolean --

Whether to become another user.

become_user

string --

The user to become.

include_type

string include

n/a

tasklist_vars

dict ordereddict()

The parameters for the tasklist.

Code

doc:
  short_help: Execute an Ansible tasklist.
  help: |
    This is a generic task to execute an Ansible tasklist

    Currently only a few basic metadata keys are supported: ``include_type``, ``become`` &``become_user``. The other ones will be added
    when necessary.

    Be aware, if the tasklist is not in the default or community resources repository, this will only work if 'allow_remote' or 'allow_remote_tasklists' is set to true in the context that is used.

args:
  name:
    doc:
      short_help: The role name.
    type: string
    required: true
    cli:
      param_type: argument
  become:
    doc:
      short_help: Whether to become another user.
    type: boolean
    required: false
  become_user:
    doc:
      short_help: The user to become.
    type: string
    empty: false
    required: false
  tasklist_vars:
    doc:
      short_help: The parameters for the tasklist.
    type: dict
    required: false
    empty: true
    default: {}
  include_type:
    doc:
      short_helop: Whether to 'include' or 'import' the role.
    type: string
    allowed:
    - include
    - import
    default: include

frecklets:
- frecklet:
    name: ansible-tasklist
    type: ansible-meta
    properties:
      elevated: '{{:: become ::}}'
  task:
    become: '{{:: become ::}}'
    become_user: '{{:: become_user ::}}'
    include-type: '{{:: include_type ::}}'
  vars:
    name: '{{:: name ::}}'
    become: '{{:: become ::}}'
    become_user: '{{:: become_user ::}}'
    vars: '{{:: tasklist_vars ::}}'
frecklecute ansible-tasklist --help

Usage: frecklecute ansible-tasklist [OPTIONS] NAME

  This is a generic task to execute an Ansible tasklist

  Currently only a few basic metadata keys are supported: ``include_type``,
  ``become`` &``become_user``. The other ones will be added when necessary.

  Be aware, if the tasklist is not in the default or community resources
  repository, this will only work if 'allow_remote' or
  'allow_remote_tasklists' is set to true in the context that is used.

Options:
  --become / --no-become         Whether to become another user.
  --become-user BECOME_USER      The user to become.
  --include-type INCLUDE_TYPE    n/a
  --tasklist-vars TASKLIST_VARS  The parameters for the tasklist.
  --help                         Show this message and exit.
# -*- coding: utf-8 -*-


#
# module path: pycklets.ansible_tasklist.AnsibleTasklist
#


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

@dataclass
class AnsibleTasklist(AutoPycklet):
    """This is a generic task to execute an Ansible tasklist

     Currently only a few basic metadata keys are supported: ``include_type``, ``become`` &``become_user``. The other ones will be added
     when necessary.

     Be aware, if the tasklist is not in the default or community resources repository, this will only work if 'allow_remote' or 'allow_remote_tasklists' is set to true in the context that is used.

       Args:
         become: Whether to become another user.
         become_user: The user to become.
         include_type: n/a
         name: The role name.
         tasklist_vars: The parameters for the tasklist.

    """

    FRECKLET_ID = "ansible-tasklist"

    become: bool = None
    become_user: str = None
    include_type: str = None
    name: str = None
    tasklist_vars: Dict = None


    def __post_init__(self):
        super(AnsibleTasklist, self).__init__(var_names=["become", "become_user", "include_type", "name", "tasklist_vars"])


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


#
# module path: pycklets.ansible_tasklist.AnsibleTasklist
#


from pyckles import AutoPycklet

class AnsibleTasklist(AutoPycklet):
    """This is a generic task to execute an Ansible tasklist

     Currently only a few basic metadata keys are supported: ``include_type``, ``become`` &``become_user``. The other ones will be added
     when necessary.

     Be aware, if the tasklist is not in the default or community resources repository, this will only work if 'allow_remote' or 'allow_remote_tasklists' is set to true in the context that is used.

       Args:
         become: Whether to become another user.
         become_user: The user to become.
         include_type: n/a
         name: The role name.
         tasklist_vars: The parameters for the tasklist.

    """

    FRECKLET_ID = "ansible-tasklist"

    def __init__(self, become=None, become_user=None, include_type="include", name=None, tasklist_vars=None):

        super(AnsibleTasklist, self).__init__(var_names=["become", "become_user", "include_type", "name", "tasklist_vars"])
        self._become = become
        self._become_user = become_user
        self._include_type = include_type
        self._name = name
        self._tasklist_vars = tasklist_vars

    @property
    def become(self):
        return self._become

    @become.setter
    def become(self, become):
        self._become = become

    @property
    def become_user(self):
        return self._become_user

    @become_user.setter
    def become_user(self, become_user):
        self._become_user = become_user

    @property
    def include_type(self):
        return self._include_type

    @include_type.setter
    def include_type(self, include_type):
        self._include_type = include_type

    @property
    def name(self):
        return self._name

    @name.setter
    def name(self, name):
        self._name = name

    @property
    def tasklist_vars(self):
        return self._tasklist_vars

    @tasklist_vars.setter
    def tasklist_vars(self, tasklist_vars):
        self._tasklist_vars = tasklist_vars



frecklet_class = AnsibleTasklist