Skip to content

Instantly share code, notes, and snippets.

View peterjenkins1's full-sized avatar
🪇

Peter Jenkins peterjenkins1

🪇
View GitHub Profile

Keybase proof

I hereby claim:

  • I am peterjenkins1 on github.
  • I am peterjenkins (https://keybase.io/peterjenkins) on keybase.
  • I have a public key whose fingerprint is A9FF 5638 FD1F C775 565E 42B5 B4AA EE96 E1B4 94D3

To claim this, I am signing this object:

@peterjenkins1
peterjenkins1 / harden-jenkins.groovy
Last active August 12, 2020 18:31
Harden Jenkins with groovy
// Harden Jenkins and remove all the nagging warnings in the web interface
import jenkins.model.Jenkins
import jenkins.security.s2m.*
Jenkins jenkins = Jenkins.getInstance()
// Disable remoting
jenkins.getDescriptor("jenkins.CLI").get().setEnabled(false)
// Enable Agent to master security subsystem
@peterjenkins1
peterjenkins1 / jenkins-deveo-notify.groovy
Created August 31, 2017 07:18
Notify deveo without a plugin ... handy when the official plugin doesn't work with Pipelines
/*
In your pipeline you can do:
// Notify deveo of build result
deveo = load 'jenkins-deveo-notify.groovy'
deveo.sendCompletedEvent(params.deveo_url, params.deveo_project, params.deveo_repo, params.deveo_name_string, params.deveo_company_key, params.deveo_account_key)
*/
import groovy.json.JsonOutput
def sendCompletedEvent(url, project, repository, name, COMPANY_KEY, ACCOUNT_KEY) {
@peterjenkins1
peterjenkins1 / images-hack.yml
Created September 22, 2017 07:46
Quick and dirty OpenStack image creation
---
# Images are defined in group_vars/all/glance-images.yml.
# imagespec is used for individual images, e.g. "-e imagespec=centos-6,centos-7".
- name: Add images to OpenStack
hosts: localhost
# This environment block shouldn't be needed, but it doesn't work otherwise!
environment:
LIBGUESTFS_BACKEND: direct
vars:
workdir: /mnt/scratch # Directory where the images are temporarily stored
@peterjenkins1
peterjenkins1 / ansible-debug-stub.yml
Last active November 6, 2018 06:29
Ansible playbook for quickly testing stuff
---
- hosts: localhost
gather_facts: false
connection: local
tasks:
- debug:
msg: Hello world!