sleep

Example:

# Wait 10 seconds.
- sleep:
    time: 10

Description

In certain situations you need to wait a bit in order for external circumstances to catch up. Ideally you'll have a different, more deterministic way of doing so (e.g. the 'wait-for-ssh' frecklet), but in some cases you might have to fall back on a simple 'sleep'.

Variables

Name Type Default Description

time

integer --

The amount of seconds to wait. Required

Examples

Example 1

Wait 10 seconds.

Code
- sleep:
    time: 10

Code

doc:
  short_help: Wait a certain amount of seconds.
  help: |
    In certain situations you need to wait a bit in order for external circumstances to catch up. Ideally you'll
    have a different, more deterministic way of doing so (e.g. the 'wait-for-ssh' frecklet), but in some cases you might have to fall back on a simple 'sleep'.
  examples:
  - title: Wait 10 seconds.
    vars:
      time: 10

args:
  time:
    doc:
      short_help: The amount of seconds to wait.
    type: integer
    required: true

frecklets:
- frecklet:
    name: wait_for
    type: ansible-module
    desc:
      short: 'sleep for {{:: time ::}} seconds'
    properties:
      elevated: false
      idempotent: false
      internet: false
  task:
    connection: local
  vars:
    timeout: '{{:: time ::}}'
frecklecute sleep --help

Usage: frecklecute sleep [OPTIONS]

  In certain situations you need to wait a bit in order for external
  circumstances to catch up. Ideally you'll have a different, more
  deterministic way of doing so (e.g. the 'wait-for-ssh' frecklet), but in
  some cases you might have to fall back on a simple 'sleep'.

Options:
  --time TIME  The amount of seconds to wait.  [required]
  --help       Show this message and exit.
# -*- coding: utf-8 -*-


#
# module path: pycklets.sleep.Sleep
#


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

@dataclass
class Sleep(AutoPycklet):
    """In certain situations you need to wait a bit in order for external circumstances to catch up. Ideally you'll
     have a different, more deterministic way of doing so (e.g. the 'wait-for-ssh' frecklet), but in some cases you might have to fall back on a simple 'sleep'.

       Args:
         time: The amount of seconds to wait.

    """

    FRECKLET_ID = "sleep"

    time: int = None


    def __post_init__(self):
        super(Sleep, self).__init__(var_names=["time"])


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


#
# module path: pycklets.sleep.Sleep
#


from pyckles import AutoPycklet

class Sleep(AutoPycklet):
    """In certain situations you need to wait a bit in order for external circumstances to catch up. Ideally you'll
     have a different, more deterministic way of doing so (e.g. the 'wait-for-ssh' frecklet), but in some cases you might have to fall back on a simple 'sleep'.

       Args:
         time: The amount of seconds to wait.

    """

    FRECKLET_ID = "sleep"

    def __init__(self, time=None):

        super(Sleep, self).__init__(var_names=["time"])
        self._time = time

    @property
    def time(self):
        return self._time

    @time.setter
    def time(self, time):
        self._time = time



frecklet_class = Sleep