Skip to content

Instantly share code, notes, and snippets.

View nmattam's full-sized avatar

Nibin Abraham Mattam nmattam

View GitHub Profile
[vagrant@bootstrap-chef ~]$ cat /var/log/opscode/postgresql/9.2/current
2017-09-11_18:11:41.45145 LOG: database system was shut down at 2017-09-11 18:11:39 GMT
2017-09-11_18:11:41.46421 LOG: database system is ready to accept connections
2017-09-11_18:11:41.46435 LOG: autovacuum launcher started
2017-09-11_18:11:41.48142 received TERM from runit, sending INT instead to force quit connections
2017-09-11_18:11:41.48225 LOG: received fast shutdown request
2017-09-11_18:11:41.48225 LOG: aborting any active transactions
2017-09-11_18:11:41.48285 LOG: autovacuum launcher shutting down
2017-09-11_18:11:41.48296 LOG: shutting down
2017-09-11_18:11:41.48685 LOG: database system is shut down
[splunk@master bin]$ ./splunk apply cluster-bundle --answer-yes -auth admin:527d668960fc2beb7afb8722f36a121209d5ec9372cdc7ea590be25b2836ce3853aa975e
Encountered some errors while applying the bundle.
No new bundle will be pushed. The master and peers already have this bundle with bundle id = 965BD255012CA3254ADC80A0B369B3B8
[root@master vagrant]# tail -f /opt/splunk/var/log/splunk/splunkd.log
08-15-2017 18:53:20.219 +0000 INFO SpecFiles - Found external scheme definition for stanza "powershell://" with 2 parameters: script, schedule
==> c2_boot1: Chef Client finished, 28/51 resources updated in 01 minutes 37 seconds
==> c2_boot1: Running provisioner: shell...
c2_boot1: Running: inline script
==> c2_boot1: cat:
==> c2_boot1: /etc/splunk/password
==> c2_boot1: : No such file or directory
==> c2_boot1: WARNING: No knife configuration file found
==> c2_boot1: ERROR: Chef::Exceptions::InvalidDataBagPath: Data bag path '/var/chef/data_bags' is invalid
==> c1_master: Running chef-client...
==> c1_master: [2017-08-10T13:50:02-05:00] WARN: Ohai::Config[:plugin_path] is set. Ohai::Config[:plugin_path] is deprecated and will be removed in future releases of ohai. Use ohai.plugin_path in your configuration file to configure :plugin_path for ohai.
==> c1_master: [2017-08-10T13:50:02-05:00] INFO: Forking chef instance to converge...
==> c1_master: Starting Chef Client, version 12.17.44
==> c1_master: [2017-08-10T13:50:02-05:00] INFO: *** Chef 12.17.44 ***
==> c1_master: [2017-08-10T13:50:02-05:00] INFO: Platform: x86_64-linux
==> c1_master: [2017-08-10T13:50:02-05:00] INFO: Chef-client pid: 4753
==> c1_master: [2017-08-10T13:50:02-05:00] WARN: Ohai::Config[:plugin_path] is set. Ohai::Config[:plugin_path] is deprecated and will be removed in future releases of ohai. Use ohai.plugin_path in your configuration file to configure :plugin_path for ohai.
==> c1_master: [2017-08-10T13:50:03-05:00] INFO: Ohai override :ipaddress to 33.33.33.11 from ["eth1", {"type"=>"eth",
@nmattam
nmattam / gist:4660e460eb0f40eb8c43c84c79e239db
Created February 17, 2017 17:33
chef-client issue with 12.18.31
- suppressed sensitive resource
==> s_standalone: [2017-02-15T14:53:58+00:00] INFO: splunk_template[system/authentication.conf] owner changed to 501
==> s_standalone: [2017-02-15T14:53:58+00:00] INFO: splunk_template[system/authentication.conf] group changed to 501
==> s_standalone: [2017-02-15T14:53:58+00:00] INFO: splunk_template[system/authentication.conf] mode changed to 600
==> s_standalone:
==> s_standalone: - change mode from '' to '0600'
==> s_standalone:
==> s_standalone: - change owner from '' to 'splunk'
==> s_standalone:
==> s_standalone: - change group from '' to 'splunk'
@nmattam
nmattam / gist:d43959d1f2e048433f0cfa83b6a5c951
Created January 26, 2017 21:01
Kitchen converging app-install-centos-67
* directory[/opt/splunk/etc/apps/test_app/metadata] action create
- create new directory /opt/splunk/etc/apps/test_app/metadata
- change owner from '' to 'splunk'
- change group from '' to 'splunk'
- restore selinux security context
* ruby_block[set config overrides] action run
- execute the ruby block set config overrides
* splunk_conf[testing.conf] action configure
* directory[/opt/splunk] action create (up to date)
- update apps/set config overrides/default/testing.conf
@nmattam
nmattam / script.rb
Created September 19, 2016 22:02 — forked from acharlieh/script.rb
Figuring out that one vagrant vault key wasn't updated
require 'chef-vault'
data = JSON.parse(File.open('data_bags/cerner_splunk/license_secrets_keys.json').read())
keys = (data['clients'] + data['admins']).inject({}) do |m,c|
pem = (c == 'knife_workstation') ? 'fake-key.pem' : "pems/#{c}.pem"
private_key = OpenSSL::PKey::RSA.new(File.open(pem).read())
m[c] = private_key.private_decrypt(Base64.decode64(data[c]))
m
end
@nmattam
nmattam / gist:32ae2d6513a561dc3c9ea1dfa7dcb9ec
Created September 1, 2016 17:52
chef-client upgrade omnibus_updater
Recipe: omnibus_updater::downloader
* directory[/var/chef/cache/omnibus_updater] action create (up to date)
* remote_file[omnibus_remote[chef-12.5.1-1.el6.x86_64.rpm]] action create_if_missing
- create new file /var/chef/cache/omnibus_updater/chef-12.5.1-1.el6.x86_64.rpm
- update content in file /var/chef/cache/omnibus_updater/chef-12.5.1-1.el6.x86_64.rpm from none to 76dda2
(file sizes exceed 10000000 bytes, diff output suppressed)
Recipe: omnibus_updater::old_package_cleaner
* file[/var/chef/cache/omnibus_updater/chef-12.4.3-1.el6.x86_64.rpm] action delete
- delete file /var/chef/cache/omnibus_updater/chef-12.4.3-1.el6.x86_64.rpm
Recipe: omnibus_updater::installer
2.1.5 :052 > te.at_xpath('/license/payload/expiration_time/text()')
=> #<Nokogiri::XML::Text:0x3fd9088d6398 "1474469242">
2.1.5 :053 > te.at_xpath('/license/payload/expiration_time/text()').to_s
=> "1474469242"
2.1.5 :054 > te.at_xpath('/license/payload/expiration_time/text()').to_s.to_i
=> 1474469242
@nmattam
nmattam / nginx_log_rotate.txt
Created February 23, 2016 20:04
nginx log rotate script
/var/log/opscode/nginx/*.log {
rotate 10
size 104857600
create 644 opscode opscode
delaycompress
sharedscripts
postrotate
/opt/opscode/embedded/sbin/nginx -s reopen
endscript
}