Skip to content

Instantly share code, notes, and snippets.

* users_manage[wheel] action create
- would create /home/drewb/.ssh
* user[drewb] action create (up to date)
* directory[/home/drewb/.ssh] action create (up to date)
* template[/home/drewb/.ssh/authorized_keys] action create (up to date)
* group[wheel] action create (up to date)
Running handlers:
Running handlers complete
Chef Client finished, 2/9 resources updated in 1.324626609 seconds
@dblessing
dblessing / gist:85b00e3b9a28ccb9c3d3
Created November 24, 2014 22:46
puppet-gitlab fail
1) gitlab mysql_enable is true should contain File[/etc/gitlab/gitlab.rb] with content =~ /gitlab_rails['postgres'] = false\n/
Failure/Error: should contain_file('/etc/gitlab/gitlab.rb').with_content(/gitlab_rails['postgres'] = false\n/)
expected that the catalogue would contain File[/etc/gitlab/gitlab.rb] with content set to /gitlab_rails['postgres'] = false\n/ but it is set to "# MANAGED BY PUPPET\n# Changes may be overwritten\n\n#\n# 1. GitLab app settings\n# ==========================\nexternal_url 'http://gitlab.example.com'\n\n#\n# 2. Auth settings\n# # ==========================\ngitlab_rails['ldap_enabled'] = false\n\n\n\n\n# 3. Advanced settings\n# ==========================\n\n#\n# 4. Extra customization\n# ==========================\n\n#\n# 5. Omnibus customization\n# ==========================\ngitlab_rails['postgres'] = false\ngitlab_rails['db_adapter'] = 'mysql2'\ngitlab_rails['db_encoding'] = 'utf8'\ngitlab_rails['db_host'] = '127.0.0.1'\ngitlab_rails['db_port'] = '3306'\ngitlab_r
def test(val)
true if val == 1
'blah'
end
test(1)
=> 'blah'
@dblessing
dblessing / gist:e797bd0ecd1e41d720bc
Last active August 29, 2015 14:07
All cluster nodes stopped gracefully. On bringing any node back up, we see (where '192.168.0.2' is a peer)
==> WARNING: Expect Mode enabled, expecting 3 servers [FAILED]
==> WARNING: It is highly recommended to set GOMAXPROCS higher than 1
==> Starting Consul agent...
==> Starting Consul agent RPC...
==> Joining cluster...
==> dial tcp 192.168.0.2:8301: connection refused
@dblessing
dblessing / error
Created September 11, 2014 18:44
Struct error
Migration leads to:
no member 'token' in struct(eval):7:in `[]='
(eval):7:in `token='
=====
class SerializeServiceProperties < ActiveRecord::Migration
def change
add_column :services, :properties, :text
package { 'percona-xtrabackup': }
ensure_packages(['percona-xtrabackup'])
---- This should work, assuming order is top down... but I get:
Error: Duplicate declaration: Package[percona-xtrabackup] is already declared in file /root/test.pp:1; cannot redeclare at /root/test.pp:3 on node example.com
class MyClass
serialize :properties, JSON
def recipients
self.properties[:recipients]
end
def recipients=(recipients)
self.properties[:recipients] = recipients
end
upstream gitlab {
server unix:/usr/share/gitlab/tmp/sockets/gitlab.socket;
}
server {
listen 443;
server_name gitlab.example.com;
@dblessing
dblessing / array
Created June 26, 2014 18:50
Puppet F5 Module
Monitor association changes string to array on one side, but other side is still a string. Causes a constantly change attempt:
-----
monitor_association changed '{"type"=>"MONITOR_RULE_TYPE_SINGLE", "quorum"=>"0", "monitor_templates"=>"/Common/MyMonitor"}' to '{"type"=>"MONITOR_RULE_TYPE_SINGLE", "monitor_templates"=>["/Common/MyMonitor"], "quorum"=>"0"}'
@dblessing
dblessing / Type
Created June 19, 2014 17:05
Boolean property
newproperty(:floating_state, boolean: true, parent: Puppet::Parameter::Boolean) do
desc 'The floating state of the self IP object'
end