Skip to content

Instantly share code, notes, and snippets.

View spiegela's full-sized avatar

Aaron Spiegel spiegela

View GitHub Profile
@spiegela
spiegela / README.md
Last active May 26, 2020 15:16
Concourse Docker Compose

Docker Compose orchestrated Concourse Setup

DRAFT

Prerequisites

  • Docker
  • Docker Compose

Installation

@spiegela
spiegela / rcc.tsx
Last active February 23, 2019 14:27
IntelliJ Live Templates for Typescript React
import {PureComponent} 'react';
export default class $TM_FILENAME_BASE$ extends PureComponent {
render() {
return (
<div>
$END$
</div>
);
}
@spiegela
spiegela / ginkgo-template.go
Created January 26, 2019 22:53
Intellij File template for Ginkgo Test
package ${GO_PACKAGE_NAME}_test
#set( $CAMEL_NAME = ${StringUtils.removeAndHump( ${GO_PACKAGE_NAME} )} )
import(
"testing"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
# razor create-policy --name memtest86 \
> --repo memtest86 --task memtest \
> --broker noop --enabled \
> --hostname 'host-${id}.lan' \
> --root-password secret --max-count 3 \
> --before 'centos-for-3' --tag dell-r710 \
> --node-metadata last-memory-check=2015-10-22
From https://localhost:8151/api/collections/policies/memtest86:
name: memtest86
# git clone https://github.com/spiegela/razor-memtest-task.git
Cloning into 'razor-memtest-task'...
remote: Counting objects: 21, done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 21 (delta 3), reused 18 (delta 3), pack-reused 0
Unpacking objects: 100% (21/21), done.
# cd razor-memtest-task/
# cp -pr memtest.task/ /opt/puppetlabs/server/apps/razor-server/share/razor-server/tasks/
# cp -pr repo/memtest86/ /opt/puppetlabs/server/data/razor-server/repo/
# systemctl restart pe-razor-server
$ razor nodes
From https://localhost:8151/api/collections/nodes:
+-------+-------------------+-----------+-----------+----------------+
| name | dhcp_mac | tags | policy | metadata count |
+-------+-------------------+-----------+-----------+----------------+
| node7 | 84:2b:2b:0a:c2:df | dell-r710 | memtest86 | 1 |
+-------+-------------------+-----------+-----------+----------------+
| node8 | a4:ba:db:33:40:8b | dell-r710 | memtest86 | 1 |
+-------+-------------------+-----------+-----------+----------------+
#!ipxe
echo Razor <%= task.label %> task boot_call
echo Installation node: <%= node_url %>
echo Installation repo: <%= repo_url %>
sleep 3
kernel <%= repo_url("/isolinux/vmlinuz") %> <%= render_template("kernel_args").strip %> || goto error
initrd <%= repo_url("/isolinux/initrd.img") %> || goto error
boot
---
os_version: 6
label: Red Hat Enterprise Linux 6
description: Red Hat Generic installer
boot_sequence:
1: boot_install
default: boot_local
$ razor create-repo --name centos7.1 --iso-url http://mirrors.usc.edu/pub/linux/distributions/centos/7.1.1503/isos/x86_64/CentOS-7-x86_64-Minimal-1503-01.iso --task centos
From https://localhost:8151/api/collections/repos/centos7.1:
name: centos7.1
iso_url: http://mirrors.usc.edu/pub/linux/distributions/centos/7.1.1503/isos/x86_64/CentOS-7-x86_64-Minimal-1503-01.iso
url: ---
task: centos
command: https://localhost:8151/api/collections/commands/45
$ razor tasks
From https://localhost:8151/api/collections/tasks:
+----------------+----------------------------------------------------------------+---------+-----------------------------------------------------+
| name | description | base | boot_seq |
+----------------+----------------------------------------------------------------+---------+-----------------------------------------------------+
| centos | CentOS 6 Installer | redhat | 1: boot_install, default: boot_local |
+----------------+----------------------------------------------------------------+---------+-----------------------------------------------------+
| centos/6 | CentOS 6 Installer | centos | 1: boot_install, default: boot_local |
+----------------+----------------------------------------------------