nginx-installed-from-source

Description

Install Nginx from source (optionally incl. pagespeed module)

Variables

Name Type Default Description

nginx_version

string --

The version of Nginx

pagespeed_version

string --

The version of pagespeed.

use_pagespeed

boolean False

Whether to use the pagespeed module.

worker_processes

integer 2

The number of Nginx worker processes.

Code

doc:
  short_help: Install Nginx from source (optionally incl. pagespeed module)

args:
  nginx_version:
    doc:
      short_help: The version of Nginx
    type: string
    required: false
  use_pagespeed:
    doc:
      short_help: Whether to use the pagespeed module.
    type: boolean
    required: false
    default: false
    cli:
      param_decls:
      - --use-pagespeed/--no-use-pagespeed
  pagespeed_version:
    doc:
      short_help: The version of pagespeed.
    type: string
    required: false
  worker_processes:
    doc:
      short_help: The number of Nginx worker processes.
    type: integer
    required: false
    default: 2

frecklets:
- frecklet:
    name: ncg.nginx
    type: ansible-role
    resources:
      ansible-role:
      - ncg.nginx
      - nickhammond.logrotate
    properties:
      elevated: true
      internet: true
      idempotent: true
  vars:
    nginx_version: '{{:: nginx_version ::}}'
    nginx_pagespeed_enabled: '{{:: use_pagespeed ::}}'
    nginx_pagespeed_version: '{{:: pagespeed_version ::}}'
    nginx_worker_processes: '{{:: worker_processes ::}}'
- init-service-configured:
    name: nginx
    enabled: true
    started: true
frecklecute nginx-installed-from-source --help

Usage: frecklecute nginx-installed-from-source [OPTIONS]

  Install Nginx from source (optionally incl. pagespeed module)

Options:
  --nginx-version NGINX_VERSION   The version of Nginx
  --pagespeed-version PAGESPEED_VERSION
                                  The version of pagespeed.
  --use-pagespeed / --no-use-pagespeed
                                  Whether to use the pagespeed module.
  --worker-processes WORKER_PROCESSES
                                  The number of Nginx worker processes.
  --help                          Show this message and exit.
# -*- coding: utf-8 -*-


#
# module path: pycklets.nginx_installed_from_source.NginxInstalledFromSource
#


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

@dataclass
class NginxInstalledFromSource(AutoPycklet):
    """Install Nginx from source (optionally incl. pagespeed module)

       Args:
         nginx_version: The version of Nginx
         pagespeed_version: The version of pagespeed.
         use_pagespeed: Whether to use the pagespeed module.
         worker_processes: The number of Nginx worker processes.

    """

    FRECKLET_ID = "nginx-installed-from-source"

    nginx_version: str = None
    pagespeed_version: str = None
    use_pagespeed: bool = None
    worker_processes: int = None


    def __post_init__(self):
        super(NginxInstalledFromSource, self).__init__(var_names=["nginx_version", "pagespeed_version", "use_pagespeed", "worker_processes"])


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


#
# module path: pycklets.nginx_installed_from_source.NginxInstalledFromSource
#


from pyckles import AutoPycklet

class NginxInstalledFromSource(AutoPycklet):
    """Install Nginx from source (optionally incl. pagespeed module)

       Args:
         nginx_version: The version of Nginx
         pagespeed_version: The version of pagespeed.
         use_pagespeed: Whether to use the pagespeed module.
         worker_processes: The number of Nginx worker processes.

    """

    FRECKLET_ID = "nginx-installed-from-source"

    def __init__(self, nginx_version=None, pagespeed_version=None, use_pagespeed=None, worker_processes=2):

        super(NginxInstalledFromSource, self).__init__(var_names=["nginx_version", "pagespeed_version", "use_pagespeed", "worker_processes"])
        self._nginx_version = nginx_version
        self._pagespeed_version = pagespeed_version
        self._use_pagespeed = use_pagespeed
        self._worker_processes = worker_processes

    @property
    def nginx_version(self):
        return self._nginx_version

    @nginx_version.setter
    def nginx_version(self, nginx_version):
        self._nginx_version = nginx_version

    @property
    def pagespeed_version(self):
        return self._pagespeed_version

    @pagespeed_version.setter
    def pagespeed_version(self, pagespeed_version):
        self._pagespeed_version = pagespeed_version

    @property
    def use_pagespeed(self):
        return self._use_pagespeed

    @use_pagespeed.setter
    def use_pagespeed(self, use_pagespeed):
        self._use_pagespeed = use_pagespeed

    @property
    def worker_processes(self):
        return self._worker_processes

    @worker_processes.setter
    def worker_processes(self, worker_processes):
        self._worker_processes = worker_processes



frecklet_class = NginxInstalledFromSource