sysctl-value

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 --help

Usage: frecklecute sysctl-value [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.SysctlValue
#


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

@dataclass
class SysctlValue(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"

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


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


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


#
# module path: pycklets.sysctl_value.SysctlValue
#


from pyckles import AutoPycklet

class SysctlValue(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"

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

        super(SysctlValue, 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 = SysctlValue