lxd-profile-present

Description

Ensure a lxd profile exists.

Resources

Variables

Name Type Default Description

name

string --

The name of the lxd profile. Required

config

dict --

The configuration for this profile.

description

string --

Description of the profile.

devices

dict --

The devices for the profile (e.g. {"rootfs": {"path": "/dev/kvm", "type": "unix-char"}).

See https://github.com/lxc/lxd/blob/master/doc/rest-api.md#patch-3

Code

doc:
  short_help: Ensure a lxd profile exists.
  references:
    Ansible 'lxd_profile' module documentation: https://docs.ansible.com/ansible/latest/modules/lxd_profile_module.html?highlight=lxd
args:
  name:
    doc:
      short_help: The name of the lxd profile.
    type: string
    required: true
  config:
    doc:
      short_help: The configuration for this profile.
    type: dict
    required: false
    empty: true
  description:
    doc:
      short_help: Description of the profile.
    type: string
    required: false
  devices:
    doc:
      short_help: The devices for the profile.
      help: |
        The devices for the profile (e.g. {"rootfs": {"path": "/dev/kvm", "type": "unix-char"}).

        See https://github.com/lxc/lxd/blob/master/doc/rest-api.md#patch-3
    type: dict
    required: false
    empty: true

frecklets:
- frecklet:
    name: lxd_profile
    type: ansible-module
    properties:
      idempotent: true
    desc:
      short: "create/update lxd profile '{{:: name ::}}'"
  vars:
    name: '{{:: name ::}}'
    state: present
    config: '{{:: config ::}}'
    description: '{{:: description ::}}'
    devices: '{{:: devices ::}}'
frecklecute lxd-profile-present --help

Usage: frecklecute lxd-profile-present [OPTIONS]

  Ensure a lxd profile exists.

Options:
  --name NAME                The name of the lxd profile.  [required]
  --config CONFIG            The configuration for this profile.
  --description DESCRIPTION  Description of the profile.
  --devices DEVICES          The devices for the profile.
  --help                     Show this message and exit.
# -*- coding: utf-8 -*-


#
# module path: pycklets.lxd_profile_present.LxdProfilePresent
#


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

@dataclass
class LxdProfilePresent(AutoPycklet):
    """Ensure a lxd profile exists.

       Args:
         config: The configuration for this profile.
         description: Description of the profile.
         devices: The devices for the profile.
         name: The name of the lxd profile.

    """

    FRECKLET_ID = "lxd-profile-present"

    config: Dict = None
    description: str = None
    devices: Dict = None
    name: str = None


    def __post_init__(self):
        super(LxdProfilePresent, self).__init__(var_names=["config", "description", "devices", "name"])


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


#
# module path: pycklets.lxd_profile_present.LxdProfilePresent
#


from pyckles import AutoPycklet

class LxdProfilePresent(AutoPycklet):
    """Ensure a lxd profile exists.

       Args:
         config: The configuration for this profile.
         description: Description of the profile.
         devices: The devices for the profile.
         name: The name of the lxd profile.

    """

    FRECKLET_ID = "lxd-profile-present"

    def __init__(self, config=None, description=None, devices=None, name=None):

        super(LxdProfilePresent, self).__init__(var_names=["config", "description", "devices", "name"])
        self._config = config
        self._description = description
        self._devices = devices
        self._name = name

    @property
    def config(self):
        return self._config

    @config.setter
    def config(self, config):
        self._config = config

    @property
    def description(self):
        return self._description

    @description.setter
    def description(self, description):
        self._description = description

    @property
    def devices(self):
        return self._devices

    @devices.setter
    def devices(self, devices):
        self._devices = devices

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

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



frecklet_class = LxdProfilePresent