sysctl-value-present

Description

Set a sysctl value.

Variables

Name Type Default Description

name

string --

The name of the sysctl variable. Required

value

n/a --

The value. Required

set

boolean False

Verify token value with the sysctl command and set with -w if necessary.

Code

doc:
  short_help: Set a sysctl value.

args:
  name:
    doc:
      short_help: The name of the sysctl variable.
    type: string
    required: true
    empty: false
  value:
    doc:
      short_help: The value.
    required: true
    empty: false
  set:
    doc:
      short_help: Verify token value with the sysctl command and set with -w if necessary.
    type: boolean
    default: false
  reload:
    doc:
      short_help: If yes, performs a /sbin/sysctl -p if the sysctl_file is updated.
        If no, does not reload sysctl even if the sysctl_file is updated.
    type: boolean
    default: true

frecklets:
- frecklet:
    name: sysctl
    type: ansible-module
    desc:
      short: 'set sysctl key: {{:: name ::}} -> {{:: value ::}}'
    properties:
      idempotent: true
      elevated: true
      internet: false
  task:
    become: true
  vars:
    name: '{{:: name ::}}'
    value: '{{:: value ::}}'
    state: present
    sysctl_set: '{{:: set ::}}'
frecklecute sysctl-value-present --help

Usage: frecklecute sysctl-value-present [OPTIONS]

  Set a sysctl value.

Options:
  --name NAME       The name of the sysctl variable.  [required]
  --value VALUE     The value.  [required]
  --set / --no-set  Verify token value with the sysctl command and set with -w
                    if necessary.
  --help            Show this message and exit.
# -*- coding: utf-8 -*-


#
# module path: pycklets.sysctl_value_present.SysctlValuePresent
#


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

@dataclass
class SysctlValuePresent(AutoPycklet):
    """Set a sysctl value.

       Args:
         name: The name of the sysctl variable.
         set: Verify token value with the sysctl command and set with -w if necessary.
         value: The value.

    """

    FRECKLET_ID = "sysctl-value-present"

    name: str = None
    set: bool = None
    value: str = None


    def __post_init__(self):
        super(SysctlValuePresent, self).__init__(var_names=["name", "set", "value"])


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


#
# module path: pycklets.sysctl_value_present.SysctlValuePresent
#


from pyckles import AutoPycklet

class SysctlValuePresent(AutoPycklet):
    """Set a sysctl value.

       Args:
         name: The name of the sysctl variable.
         set: Verify token value with the sysctl command and set with -w if necessary.
         value: The value.

    """

    FRECKLET_ID = "sysctl-value-present"

    def __init__(self, name=None, set=None, value=None):

        super(SysctlValuePresent, self).__init__(var_names=["name", "set", "value"])
        self._name = name
        self._set = set
        self._value = value

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

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

    @property
    def set(self):
        return self._set

    @set.setter
    def set(self, set):
        self._set = set

    @property
    def value(self):
        return self._value

    @value.setter
    def value(self, value):
        self._value = value



frecklet_class = SysctlValuePresent