Skip to content

Instantly share code, notes, and snippets.

View asasfu's full-sized avatar

asasfu

  • Simon Fraser University
View GitHub Profile
@asasfu
asasfu / epp
Created November 20, 2017 03:05
Puppet agent -t (puppetmaster) vs puppet apply(masterless)
#######################################################################
###
### Filesystem checks
###
<% if $nhc::check_fs_mount { -%>
<% $nhc::check_fs_mount.each |$fs_struct| { -%>
<%
$function = $fs_struct['fs_mode'] ? {
'ro' => 'check_fs_mount_ro',
'rw' => 'check_fs_mount_rw',
Documentation states answer file for console should have details about r10k/code-manager, the install package examples have them in
the master file, not the console one; console would be the correct one to place them in...
https://docs.puppet.com/pe/latest/install_split_console_answers.html#qpuppetmasterr10kremotegityourgitservercompuppetcontrolgit
codemanager autoconfigure is a little misleading:
https://docs.puppet.com/pe/latest/code_mgr_config.html#qpuppetmastercodemanagerautoconfigure
It still requires these tasks to complete it:
1. Create your code deployment user, since that doesn't get done in answer file so that you can make a token in which to use for binary, webhook or custom url
2. Finally trigger `puppet-code` binary or a URL with token
@asasfu
asasfu / console-services.log
Last active April 27, 2016 22:04
After install, error
2016-04-27 12:15:10,329 INFO [p.r.h.m.authentication] Received request with whitelisted certifica
te: <mydomain>
2016-04-27 12:15:10,343 INFO [p.c.class-updater] Requesting environment list from "https://<mydomain>:8140/puppet/v3/environments"
2016-04-27 12:15:10,395 INFO [c.z.h.HikariDataSource] HikariCP pool HikariPool-2 is starting.
2016-04-27 12:15:10,714 INFO [p.c.class-updater] 200 response received for request for environmen
ts from "https://<mydomain>:8140/puppet/v3/environments"
2016-04-27 12:15:10,722 ERROR [p.t.s.s.status-core] Status check threw an exception
clojure.lang.ArityException: Wrong number of args (3) passed to: class-updater/eval23400/get-class
es-for-environment--23405
at clojure.lang.AFn.throwArity(AFn.java:429) [console-services-release.jar:na]
@asasfu
asasfu / augeas.rb
Created November 20, 2015 16:26
Fix for augeasproviders_pam
def in_position?
unless resource[:position].nil?
path, before = self.class.position_path(resource[:position], resource[:type])
mpath = "#{resource_path}[preceding-sibling::#{path}]"
augopen do |aug|
augmatch = aug.match(mpath).empty?
augmatch = before == 'before' ? augmatch : !augmatch
end
@asasfu
asasfu / service_provider_func.rb
Created October 1, 2015 17:13
A way to better support service_provider_fact
module Puppet::Parser::Functions
newfunction(:service_provider_func, :type => :rvalue, :doc => <<-EOS
Returns the default service provider for the system overridden by any parent class
that has Service { provider => $my_service_provider } specified to cause an override.
This is useful when we actually need to know the clients service provider and allow them
to also override it in case they decide they need a different one due to puppet not picking
the right one for their new or old Operating System.
Example:
Centos 7(systemd)