salt.modules.modjk

Control Modjk via the Apache Tomcat "Status" worker (http://tomcat.apache.org/connectors-doc/reference/status.html)

Below is an example of the configuration needed for this module. This configuration data can be placed either in grains or pillar.

If using grains, this can be accomplished statically or via a grain module.

If using pillar, the yaml configuration can be placed directly into a pillar SLS file, making this both the easier and more dynamic method of configuring this module.

modjk:
  default:
    url: http://localhost/jkstatus
    user: modjk
    pass: secret
    realm: authentication realm for digest passwords
    timeout: 5
  otherVhost:
    url: http://otherVhost/jkstatus
    user: modjk
    pass: secret2
    realm: authentication realm2 for digest passwords
    timeout: 600
salt.modules.modjk.bulk_activate(workers, lbn, profile=u'default')

Activate all the given workers in the specific load balancer

CLI Examples:

salt '*' modjk.bulk_activate node1,node2,node3 loadbalancer1
salt '*' modjk.bulk_activate node1,node2,node3 loadbalancer1 other-profile

salt '*' modjk.bulk_activate ["node1","node2","node3"] loadbalancer1
salt '*' modjk.bulk_activate ["node1","node2","node3"] loadbalancer1 other-profile
salt.modules.modjk.bulk_disable(workers, lbn, profile=u'default')

Disable all the given workers in the specific load balancer

CLI Examples:

salt '*' modjk.bulk_disable node1,node2,node3 loadbalancer1
salt '*' modjk.bulk_disable node1,node2,node3 loadbalancer1 other-profile

salt '*' modjk.bulk_disable ["node1","node2","node3"] loadbalancer1
salt '*' modjk.bulk_disable ["node1","node2","node3"] loadbalancer1 other-profile
salt.modules.modjk.bulk_recover(workers, lbn, profile=u'default')

Recover all the given workers in the specific load balancer

CLI Examples:

salt '*' modjk.bulk_recover node1,node2,node3 loadbalancer1
salt '*' modjk.bulk_recover node1,node2,node3 loadbalancer1 other-profile

salt '*' modjk.bulk_recover ["node1","node2","node3"] loadbalancer1
salt '*' modjk.bulk_recover ["node1","node2","node3"] loadbalancer1 other-profile
salt.modules.modjk.bulk_stop(workers, lbn, profile=u'default')

Stop all the given workers in the specific load balancer

CLI Examples:

salt '*' modjk.bulk_stop node1,node2,node3 loadbalancer1
salt '*' modjk.bulk_stop node1,node2,node3 loadbalancer1 other-profile

salt '*' modjk.bulk_stop ["node1","node2","node3"] loadbalancer1
salt '*' modjk.bulk_stop ["node1","node2","node3"] loadbalancer1 other-profile
salt.modules.modjk.dump_config(profile=u'default')

Dump the original configuration that was loaded from disk

CLI Examples:

salt '*' modjk.dump_config
salt '*' modjk.dump_config other-profile
salt.modules.modjk.get_running(profile=u'default')

Get the current running config (not from disk)

CLI Examples:

salt '*' modjk.get_running
salt '*' modjk.get_running other-profile
salt.modules.modjk.lb_edit(lbn, settings, profile=u'default')

Edit the loadbalancer settings

Note: http://tomcat.apache.org/connectors-doc/reference/status.html Data Parameters for the standard Update Action

CLI Examples:

salt '*' modjk.lb_edit loadbalancer1 "{'vlr': 1, 'vlt': 60}"
salt '*' modjk.lb_edit loadbalancer1 "{'vlr': 1, 'vlt': 60}" other-profile
salt.modules.modjk.list_configured_members(lbn, profile=u'default')

Return a list of member workers from the configuration files

CLI Examples:

salt '*' modjk.list_configured_members loadbalancer1
salt '*' modjk.list_configured_members loadbalancer1 other-profile
salt.modules.modjk.recover_all(lbn, profile=u'default')

Set the all the workers in lbn to recover and activate them if they are not

CLI Examples:

salt '*' modjk.recover_all loadbalancer1
salt '*' modjk.recover_all loadbalancer1 other-profile
salt.modules.modjk.reset_stats(lbn, profile=u'default')

Reset all runtime statistics for the load balancer

CLI Examples:

salt '*' modjk.reset_stats loadbalancer1
salt '*' modjk.reset_stats loadbalancer1 other-profile
salt.modules.modjk.version(profile=u'default')

Return the modjk version

CLI Examples:

salt '*' modjk.version
salt '*' modjk.version other-profile
salt.modules.modjk.worker_activate(worker, lbn, profile=u'default')

Set the worker to activate state in the lbn load balancer

CLI Examples:

salt '*' modjk.worker_activate node1 loadbalancer1
salt '*' modjk.worker_activate node1 loadbalancer1 other-profile
salt.modules.modjk.worker_disable(worker, lbn, profile=u'default')

Set the worker to disable state in the lbn load balancer

CLI Examples:

salt '*' modjk.worker_disable node1 loadbalancer1
salt '*' modjk.worker_disable node1 loadbalancer1 other-profile
salt.modules.modjk.worker_edit(worker, lbn, settings, profile=u'default')

Edit the worker settings

Note: http://tomcat.apache.org/connectors-doc/reference/status.html Data Parameters for the standard Update Action

CLI Examples:

salt '*' modjk.worker_edit node1 loadbalancer1 "{'vwf': 500, 'vwd': 60}"
salt '*' modjk.worker_edit node1 loadbalancer1 "{'vwf': 500, 'vwd': 60}" other-profile
salt.modules.modjk.worker_recover(worker, lbn, profile=u'default')

Set the worker to recover this module will fail if it is in OK state

CLI Examples:

salt '*' modjk.worker_recover node1 loadbalancer1
salt '*' modjk.worker_recover node1 loadbalancer1 other-profile
salt.modules.modjk.worker_status(worker, profile=u'default')

Return the state of the worker

CLI Examples:

salt '*' modjk.worker_status node1
salt '*' modjk.worker_status node1 other-profile
salt.modules.modjk.worker_stop(worker, lbn, profile=u'default')

Set the worker to stopped state in the lbn load balancer

CLI Examples:

salt '*' modjk.worker_activate node1 loadbalancer1
salt '*' modjk.worker_activate node1 loadbalancer1 other-profile
salt.modules.modjk.workers(profile=u'default')

Return a list of member workers and their status

CLI Examples:

salt '*' modjk.workers
salt '*' modjk.workers other-profile