Skip to content

Instantly share code, notes, and snippets.

@domcleal
domcleal / core1
Last active August 27, 2015 13:59
Package rebuild order for Foreman's SCL-enabled RPMs as of August 2015
tfm
1) Failure:
Api::V1::ConfigTemplatesControllerTest#test_0008_should destroy [/home/dcleal/code/foreman/foreman/test/functional/api/v1/config_templates_controller_test.rb:60]:
Expected response to be a <:ok>, but was <500>
2) Failure:
Api::V2::ConfigTemplatesControllerTest#test_0008_should destroy [/home/dcleal/code/foreman/foreman/test/functional/api/v2/config_templates_controller_test.rb:60]:
Expected response to be a <:ok>, but was <500>
3) Failure:
ConfigTemplatesControllerTest#test_destroy [/home/dcleal/code/foreman/foreman/test/functional/config_templates_controller_test.rb:55]:
# Chef configuration snippet
#
# Uses the following parameters:
# - chef-validation-key: PEM-formatted validation key
# - chef-url: URL to the Chef server, e.g. https://chef.example.com
# - chef-runlist: comma-separated runlist, e.g. role[bootstrap],role[base]
# - chef: when 'true', runs this snippet
<% if @host.param_true?('chef') %>
curl -L https://www.opscode.com/chef/install.sh | bash
augeas { "test":
context => "/files/etc/sudoers",
changes => [
"set /files/etc/sudoers/Cmnd_Alias[alias/name = 'FOREMAN_PROXY_COMMANDS']/alias/name \"FOREMAN_PROXY_COMMANDS\"",
"set /files/etc/sudoers/Cmnd_Alias[alias/name = 'FOREMAN_PROXY_COMMANDS']/alias/command[1] \"puppet cert *\"",
"set /files/etc/sudoers/Cmnd_Alias[alias/name = 'FOREMAN_PROXY_COMMANDS']/alias/command[2] \"puppet kick *\"",
"set /files/etc/sudoers/Runas_Alias[alias/name = 'FOREMAN_PROXY_RUNAS']/alias/name \"FOREMAN_PROXY_RUNAS\"",
"set /files/etc/sudoers/Runas_Alias[alias/name = 'FOREMAN_PROXY_RUNAS']/alias/runas_user[1] \"root\"",
"set /files/etc/sudoers/Runas_Alias[alias/name = 'FOREMAN_PROXY_RUNAS']/alias/runas_user[2] \"foreman-proxy\"",
"set /files/etc/sudoers/spec[user = 'foreman-proxy']/user \"foreman-proxy\"",
all good on v3.3.3...
[root@foremanf19 ~]# puppet module install puppetlabs/postgresql
Notice: Preparing to install into /etc/puppet/modules ...
Notice: Downloading from https://forge.puppetlabs.com ...
Notice: Installing -- do not interrupt ...
/etc/puppet/modules
└─┬ puppetlabs-postgresql (v3.3.3)
├── puppetlabs-apt (v1.5.0)
├── puppetlabs-concat (v1.1.0)
@domcleal
domcleal / augeas.md
Last active August 29, 2015 14:11 — forked from riton/augeas.md

After first puppet execution

augtool> print /files/etc/services/service-name[.="kerberos"]
/files/etc/services/service-name[171] = "kerberos"
/files/etc/services/service-name[171]/port = "88"
/files/etc/services/service-name[171]/protocol = "tcp"
/files/etc/services/service-name[171]/alias[1] = "kerberos5"
/files/etc/services/service-name[171]/alias[2] = "krb5"
/files/etc/services/service-name[171]/alias[3] = "kerberos-sec"
@domcleal
domcleal / augeas.md
Last active August 29, 2015 14:11 — forked from riton/augeas.md

After first puppet execution

augtool> print /files/etc/services/service-name[.="kerberos"]
/files/etc/services/service-name[171] = "kerberos"
/files/etc/services/service-name[171]/port = "88"
/files/etc/services/service-name[171]/protocol = "tcp"
/files/etc/services/service-name[171]/alias[1] = "kerberos5"
/files/etc/services/service-name[171]/alias[2] = "krb5"
/files/etc/services/service-name[171]/alias[3] = "kerberos-sec"
Info: Applying configuration version '1418826679'
Debug: Augeas[kerberos_etc_services](provider=augeas): Opening augeas with root /, lens path /var/lib/puppet/lib/augeas/lenses, flags 32
Debug: Augeas[kerberos_etc_services](provider=augeas): Augeas version 1.0.0 is installed
Debug: Augeas[kerberos_etc_services](provider=augeas): Will attempt to save and only run if files changed
Debug: Augeas[kerberos_etc_services](provider=augeas): sending command 'defnode' with params ["kerberostcp", "/files/etc/services/service-name[.=\"kerberos\"][protocol = \"tcp\"]", "kerberos"]
Debug: Augeas[kerberos_etc_services](provider=augeas): sending command 'set' with params ["$kerberostcp/port", "88"]
Debug: Augeas[kerberos_etc_services](provider=augeas): sending command 'set' with params ["$kerberostcp/protocol", "tcp"]
Debug: Augeas[kerberos_etc_services](provider=augeas): sending command 'remove' with params ["$kerberostcp/alias"]
Debug: Augeas[kerberos_etc_services](provider=augeas): sending command 'ins' with params ["
### Keybase proof
I hereby claim:
* I am domcleal on github.
* I am domcleal (https://keybase.io/domcleal) on keybase.
* I have a public key whose fingerprint is 7AAE 76FE 90ED 4439 5624 04A2 7C7D 326F 2C2B 72CC
To claim this, I am signing this object:
@domcleal
domcleal / sync_templates.sh
Created March 10, 2015 09:46
Simple script to sync community-templates into foreman's app/views/unattended
#!/bin/bash
REPO=$(mktemp -d)
trap "rm -rf $REPO" EXIT
git clone https://github.com/theforeman/community-templates $REPO/ct
# move into destination dir if run from Foreman root
[ -d app/views/unattended ] && cd app/views/unattended