keycloak-postgresql-helper-script-file

Description

n/a

Variables

Name Type Default Description

path

string --

The path to the file. Required

postgresql_driver_jar

string --

The location to the postgres driver jar. Required

group

string --

The group of the file.

keycloak_db_name

string keycloak

The name of the keycloak db.

keycloak_db_password

string keycloak

The password for the keycloak db.

keycloak_db_user

string keycloak

The user for the keycloak db.

mode

string --

The permissions of the file.

owner

string --

The owner of the file.

Code

args:
  postgresql_driver_jar:
    doc: The location to the postgres driver jar.
    type: string
    required: true
  keycloak_db_name:
    doc: The name of the keycloak db.
    type: string
    required: true
    default: keycloak
  keycloak_db_password:
    doc: The password for the keycloak db.
    type: string
    secret: true
    required: true
    default: keycloak
  keycloak_db_user:
    doc: The user for the keycloak db.
    type: string
    required: true
    default: keycloak
  _import:
  - file-with-content
frecklets:
- file-with-content:
    path: '{{:: path ::}}'
    group: '{{:: group ::}}'
    owner: '{{:: owner ::}}'
    mode: '{{:: mode ::}}'
    content: |-
      embed-server --server-config=standalone.xml --std-out=echo

      batch
      #
      # remove the default provided datasource
      #
      /subsystem=datasources/data-source=KeycloakDS/:remove

      #
      # add it back using PostgreSQL
      #
      module add --name=org.postgres --resources={{:: postgresql_driver_jar ::}} --dependencies=javax.api,javax.transaction.api

      /subsystem=datasources/jdbc-driver=postgres:add(driver-name="postgres",driver-module-name="org.postgres",driver-class-name=org.postgresql.Driver)

      /subsystem=datasources/data-source=KeycloakDS/:add(connection-url=jdbc:postgresql://localhost:5432/{{:: keycloak_db_name ::}},driver-name=postgres,jndi-name=java:jboss/datasources/KeycloakDS,password={{:: keycloak_db_password ::}},user-name={{:: keycloak_db_user ::}})

      run-batch
frecklecute keycloak-postgresql-helper-script-file --help

Usage: frecklecute keycloak-postgresql-helper-script-file [OPTIONS] PATH

  n/a

Options:
  --postgresql-driver-jar POSTGRESQL_DRIVER_JAR
                                  The location to the postgres driver jar.
                                  [required]
  --group GROUP                   The group of the file.
  --keycloak-db-name KEYCLOAK_DB_NAME
                                  The name of the keycloak db.
  --keycloak-db-password KEYCLOAK_DB_PASSWORD
                                  The password for the keycloak db.
  --keycloak-db-user KEYCLOAK_DB_USER
                                  The user for the keycloak db.
  --mode MODE                     The permissions of the file.
  --owner USER                    The owner of the file.
  --help                          Show this message and exit.
# -*- coding: utf-8 -*-


#
# module path: pycklets.keycloak_postgresql_helper_script_file.KeycloakPostgresqlHelperScriptFile
#


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

@dataclass
class KeycloakPostgresqlHelperScriptFile(AutoPycklet):
    """No documentation available.

       Args:
         group: The group of the file.
         keycloak_db_name: The name of the keycloak db.
         keycloak_db_password: The password for the keycloak db.
         keycloak_db_user: The user for the keycloak db.
         mode: The permissions of the file.
         owner: The owner of the file.
         path: The path to the file.
         postgresql_driver_jar: The location to the postgres driver jar.

    """

    FRECKLET_ID = "keycloak-postgresql-helper-script-file"

    group: str = None
    keycloak_db_name: str = None
    keycloak_db_password: str = None
    keycloak_db_user: str = None
    mode: str = None
    owner: str = None
    path: str = None
    postgresql_driver_jar: str = None


    def __post_init__(self):
        super(KeycloakPostgresqlHelperScriptFile, self).__init__(var_names=["group", "keycloak_db_name", "keycloak_db_password", "keycloak_db_user", "mode", "owner", "path", "postgresql_driver_jar"])


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


#
# module path: pycklets.keycloak_postgresql_helper_script_file.KeycloakPostgresqlHelperScriptFile
#


from pyckles import AutoPycklet

class KeycloakPostgresqlHelperScriptFile(AutoPycklet):
    """No documentation available.

       Args:
         group: The group of the file.
         keycloak_db_name: The name of the keycloak db.
         keycloak_db_password: The password for the keycloak db.
         keycloak_db_user: The user for the keycloak db.
         mode: The permissions of the file.
         owner: The owner of the file.
         path: The path to the file.
         postgresql_driver_jar: The location to the postgres driver jar.

    """

    FRECKLET_ID = "keycloak-postgresql-helper-script-file"

    def __init__(self, group=None, keycloak_db_name="keycloak", keycloak_db_password="keycloak", keycloak_db_user="keycloak", mode=None, owner=None, path=None, postgresql_driver_jar=None):

        super(KeycloakPostgresqlHelperScriptFile, self).__init__(var_names=["group", "keycloak_db_name", "keycloak_db_password", "keycloak_db_user", "mode", "owner", "path", "postgresql_driver_jar"])
        self._group = group
        self._keycloak_db_name = keycloak_db_name
        self._keycloak_db_password = keycloak_db_password
        self._keycloak_db_user = keycloak_db_user
        self._mode = mode
        self._owner = owner
        self._path = path
        self._postgresql_driver_jar = postgresql_driver_jar

    @property
    def group(self):
        return self._group

    @group.setter
    def group(self, group):
        self._group = group

    @property
    def keycloak_db_name(self):
        return self._keycloak_db_name

    @keycloak_db_name.setter
    def keycloak_db_name(self, keycloak_db_name):
        self._keycloak_db_name = keycloak_db_name

    @property
    def keycloak_db_password(self):
        return self._keycloak_db_password

    @keycloak_db_password.setter
    def keycloak_db_password(self, keycloak_db_password):
        self._keycloak_db_password = keycloak_db_password

    @property
    def keycloak_db_user(self):
        return self._keycloak_db_user

    @keycloak_db_user.setter
    def keycloak_db_user(self, keycloak_db_user):
        self._keycloak_db_user = keycloak_db_user

    @property
    def mode(self):
        return self._mode

    @mode.setter
    def mode(self, mode):
        self._mode = mode

    @property
    def owner(self):
        return self._owner

    @owner.setter
    def owner(self, owner):
        self._owner = owner

    @property
    def path(self):
        return self._path

    @path.setter
    def path(self, path):
        self._path = path

    @property
    def postgresql_driver_jar(self):
        return self._postgresql_driver_jar

    @postgresql_driver_jar.setter
    def postgresql_driver_jar(self, postgresql_driver_jar):
        self._postgresql_driver_jar = postgresql_driver_jar



frecklet_class = KeycloakPostgresqlHelperScriptFile