devpi-installed

Example:

# Install the devpi python package in it's own virtualenv.
- devpi-installed:
    devpi_user: devpi
    devpi_host: localhost
    devpi_root_password: password123

Description

Install a devpi Python package repository.

If a password is provided but one is already set on the service, this will fail and the error will be ignored.

Resources

Variables

Name Type Default Description

admin_password

string --

If a password is already set, this will fail and the error will be ignored.

devpi_server_base

string --

Only set that if you know what you are doing.

devpi_virtualenv

string --

Only set that if you know what you are doing.

host

n/a localhost

The domain/ip to listen on, defaults to 'localhost'.

port

integer 3141

The port to listen on.

user

n/a {{ ansible_env.USER }}

The user to run the devpi service.

Examples

Example 1

Install the devpi python package in it's own virtualenv.

Code
- devpi-installed:
    devpi_user: devpi
    devpi_host: localhost
    devpi_root_password: password123

Code

doc:
  short_help: Ensures the devpi service is installed and running.
  help: |
    Install a devpi Python package repository.

    If a password is provided but one is already set on the service, this will fail and the error will be ignored.

  references:
    freckfrackery.install-devpi Ansible role: https://gitlab.com/freckfrackery/freckfrackery.install-devpi
  examples:
  - title: Install the devpi python package in it's own virtualenv.
    vars:
      devpi_user: devpi
      devpi_host: localhost
      devpi_root_password: password123

args:
  user:
    default: '{{ ansible_env.USER }}'
    doc:
      short_help: The user to run the devpi service.
    required: false
  host:
    default: localhost
    doc:
      short_help: The domain/ip to listen on, defaults to 'localhost'.
    required: false
  port:
    default: 3141
    type: integer
    doc:
      short_help: The port to listen on.
    required: false
  admin_password:
    type: string
    required: false
    doc:
      short_help: The initial admin password.
      help: |
        If a password is already set, this will fail and the error will be ignored.
  devpi_virtualenv:
    doc:
      short_help: The folder for the devpi virtualenv.
      help: |
        Only set that if you know what you are doing.
    type: string
    required: false
  devpi_server_base:
    doc:
      short_help: The folder for the devpi server folder.
      help: |
        Only set that if you know what you are doing.
    type: string
    required: false

meta:
  tags:
  - devpi
  - python
  - repository
  - packages
  - featured-frecklecutable
  - install

frecklets:
- frecklet:
    type: ansible-role
    name: freckfrackery.install-devpi
    properties:
      elevated: true
      internet: true
      idempotent: true
    desc:
      short: install devpi service
    resources:
      ansible-role:
      - freckfrackery.install-devpi
      - tumf.systemd-service
  vars:
    devpi_user: '{{:: user ::}}'
    devpi_port: '{{:: port ::}}'
    devpi_host: '{{:: host ::}}'
    devpi_root_password: '{{:: admin_password ::}}'
    devpi_virtualenv: '{{:: devpi_virtualenv ::}}'
    devpi_server_base_folder: '{{:: devpi_server_base ::}}'
frecklecute devpi-installed --help

Usage: frecklecute devpi-installed [OPTIONS]

  Install a devpi Python package repository.

  If a password is provided but one is already set on the service, this will
  fail and the error will be ignored.

Options:
  --admin-password ADMIN_PASSWORD
                                  The initial admin password.
  --devpi-server-base DEVPI_SERVER_BASE
                                  The folder for the devpi server folder.
  --devpi-virtualenv DEVPI_VIRTUALENV
                                  The folder for the devpi virtualenv.
  --host HOST                     The domain/ip to listen on, defaults to
                                  'localhost'.
  --port PORT                     The port to listen on.
  --user USER                     The user to run the devpi service.
  --help                          Show this message and exit.
# -*- coding: utf-8 -*-


#
# module path: pycklets.devpi_installed.DevpiInstalled
#


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

@dataclass
class DevpiInstalled(AutoPycklet):
    """Install a devpi Python package repository.

     If a password is provided but one is already set on the service, this will fail and the error will be ignored.

       Args:
         admin_password: The initial admin password.
         devpi_server_base: The folder for the devpi server folder.
         devpi_virtualenv: The folder for the devpi virtualenv.
         host: The domain/ip to listen on, defaults to 'localhost'.
         port: The port to listen on.
         user: The user to run the devpi service.

    """

    FRECKLET_ID = "devpi-installed"

    admin_password: str = None
    devpi_server_base: str = None
    devpi_virtualenv: str = None
    host: str = None
    port: int = None
    user: str = None


    def __post_init__(self):
        super(DevpiInstalled, self).__init__(var_names=["admin_password", "devpi_server_base", "devpi_virtualenv", "host", "port", "user"])


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


#
# module path: pycklets.devpi_installed.DevpiInstalled
#


from pyckles import AutoPycklet

class DevpiInstalled(AutoPycklet):
    """Install a devpi Python package repository.

     If a password is provided but one is already set on the service, this will fail and the error will be ignored.

       Args:
         admin_password: The initial admin password.
         devpi_server_base: The folder for the devpi server folder.
         devpi_virtualenv: The folder for the devpi virtualenv.
         host: The domain/ip to listen on, defaults to 'localhost'.
         port: The port to listen on.
         user: The user to run the devpi service.

    """

    FRECKLET_ID = "devpi-installed"

    def __init__(self, admin_password=None, devpi_server_base=None, devpi_virtualenv=None, host="localhost", port=3141, user="{{ ansible_env.USER }}"):

        super(DevpiInstalled, self).__init__(var_names=["admin_password", "devpi_server_base", "devpi_virtualenv", "host", "port", "user"])
        self._admin_password = admin_password
        self._devpi_server_base = devpi_server_base
        self._devpi_virtualenv = devpi_virtualenv
        self._host = host
        self._port = port
        self._user = user

    @property
    def admin_password(self):
        return self._admin_password

    @admin_password.setter
    def admin_password(self, admin_password):
        self._admin_password = admin_password

    @property
    def devpi_server_base(self):
        return self._devpi_server_base

    @devpi_server_base.setter
    def devpi_server_base(self, devpi_server_base):
        self._devpi_server_base = devpi_server_base

    @property
    def devpi_virtualenv(self):
        return self._devpi_virtualenv

    @devpi_virtualenv.setter
    def devpi_virtualenv(self, devpi_virtualenv):
        self._devpi_virtualenv = devpi_virtualenv

    @property
    def host(self):
        return self._host

    @host.setter
    def host(self, host):
        self._host = host

    @property
    def port(self):
        return self._port

    @port.setter
    def port(self, port):
        self._port = port

    @property
    def user(self):
        return self._user

    @user.setter
    def user(self, user):
        self._user = user



frecklet_class = DevpiInstalled