Skip to content

Instantly share code, notes, and snippets.

@gschueler
gschueler / nodeadd.sh
Created April 23, 2013 23:48
Script to add a new node definition for Rundeck by SSHing to the node to determine details
#!/bin/bash
PROJ=$1
shift
USERNODE=$1
shift
TAGS="$*"
( echo $USERNODE | grep -q '@' ) && {
---
description: API Application level access control
context:
application: 'rundeck'
for:
resource:
- equals:
kind: system
allow: [read] # allow read of system info
@gschueler
gschueler / rundeck-config.groovy
Created June 4, 2013 16:18
Example rundeck-config for SMTP mail configuration
loglevel.default = "DEBUG"
rdeck.base = "/var/lib/rundeck"
rss.enabled = true
dataSource {
dbCreate = "update"
url = "jdbc:h2:file:/var/lib/rundeck/data/rundeckdb;MVCC=true"
}
@gschueler
gschueler / LogstashPlugin.groovy
Last active October 25, 2023 22:01
Rundeck streaming log writer and Logstash input
import com.dtolabs.rundeck.plugins.logging.StreamingLogWriterPlugin;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.dtolabs.rundeck.core.logging.LogEvent;
import com.dtolabs.rundeck.core.logging.LogLevel;
/**
* Opens a TCP connection, and writes JSON event messages to the socket
*/
rundeckPlugin(StreamingLogWriterPlugin){
configuration{
@gschueler
gschueler / aclpolicy-template.yaml
Created September 24, 2013 20:56
template aclpolicy file
description: Project scope for group
context:
project: '.*'
for:
job:
- equals:
group: 'example'
name: 'Restart'
allow: [run,read]
- equals:
{
"steps": [
{
"executionState": "SUCCEEDED",
"id": 1,
"stepTargetNodes": [
"dignan"
],
"nodeStates": {
"dignan": {
// import us.schueler.greg.Rest
//base
Rest.baseUrl=args[0]
def projectName=args[1]
def token =System.getenv()['rd_token']
@gschueler
gschueler / policy1.yaml
Last active May 4, 2017 17:27
example restriction for group to set of jobs
description: Admin, all access.
context:
project: '.*' # all projects
for:
resource:
- allow: '*' # allow read/create all kinds
adhoc:
- allow: '*' # allow read/running/killing adhoc jobs
job:
- match:
package com.dtolabs.rundeck.app.internal.logging
import com.dtolabs.rundeck.core.execution.Contextual
import com.dtolabs.rundeck.core.logging.LogLevel
import com.dtolabs.rundeck.core.logging.LogUtil
import com.dtolabs.rundeck.core.logging.StreamingLogWriter
/**
Thread local buffered log output