init-service-enabled

Example:

# Enable the 'apache2' service.
- init-service-enabled:
    name: apache2

Description

Make sure an init service is enabled.

Variables

Name Type Default Description

name

string --

The name of the service. Required

Examples

Example 1

Enable the 'apache2' service.

Code
- init-service-enabled:
    name: apache2
Description

This doesn't start the service if it is not currently running.

Code

doc:
  short_help: Enable init-service.
  help: |
    Make sure an init service is enabled.
  examples:
  - title: Enable the 'apache2' service.
    desc: |
      This doesn't start the service if it is not currently running.
    vars:
      name: apache2

args:
  name:
    doc:
      short_help: The name of the service.
    type: string
    required: true
    cli:
      metavar: SERVICE_NAME
      param_type: argument

meta:
  tags:
  - init
  - systemd
  - service

frecklets:
- init-service-configured:
    enabled: true
    name: '{{:: name ::}}'
frecklecute init-service-enabled --help

Usage: frecklecute init-service-enabled [OPTIONS] SERVICE_NAME

  Make sure an init service is enabled.

Options:
  --help  Show this message and exit.
# -*- coding: utf-8 -*-


#
# module path: pycklets.init_service_enabled.InitServiceEnabled
#


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

@dataclass
class InitServiceEnabled(AutoPycklet):
    """Make sure an init service is enabled.

       Args:
         name: The name of the service.

    """

    FRECKLET_ID = "init-service-enabled"

    name: str = None


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


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


#
# module path: pycklets.init_service_enabled.InitServiceEnabled
#


from pyckles import AutoPycklet

class InitServiceEnabled(AutoPycklet):
    """Make sure an init service is enabled.

       Args:
         name: The name of the service.

    """

    FRECKLET_ID = "init-service-enabled"

    def __init__(self, name=None):

        super(InitServiceEnabled, self).__init__(var_names=["name"])
        self._name = name

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

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



frecklet_class = InitServiceEnabled