This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| db001.example.jp: | |
| :roles: | |
| - base | |
| - db | |
| :server_id: 101 | |
| db002.example.jp: | |
| :roles: | |
| - base | |
| - db | |
| :server_id: 102 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rake' | |
| require 'rspec/core/rake_task' | |
| require 'yaml' | |
| attributes = YAML.load_file('attributes.yml') | |
| desc "Run serverspec to all hosts" | |
| task :serverspec => 'serverspec:all' | |
| namespace :serverspec do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'serverspec' | |
| require 'pathname' | |
| require 'net/ssh' | |
| require 'yaml' | |
| include Serverspec::Helper::Ssh | |
| include Serverspec::Helper::DetectOS | |
| include Serverspec::Helper::Attributes | |
| attributes = YAML.load_file('attributes.yml') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'spec_helper' | |
| describe '/etc/my.cnf' do | |
| it { should contain "server-id = #{attr[:server_id]}" } | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # Puppet command running without SSL. Try: | |
| # $ ruby puppet.rb master --debug --no-daemonize --logdest console | |
| # $ ruby puppet.rb agent --server 127.0.0.1 --debug --no-daemonize --onetime --noop | |
| require "puppet/util/command_line" | |
| require "puppet/network/http/connection" | |
| require "puppet/network/http/webrick" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class people::mizzy { | |
| include iterm2::stable | |
| $home = "/Users/${::luser}" | |
| $our_boxen = "${home}/src/our-boxen" | |
| file { "${home}/Library/Preferences/com.googlecode.iterm2.plist": | |
| ensure => link, | |
| target => "${our_boxen}/preferences/com.googlecode.iterm2.plist", | |
| require => Class['iterm2::stable'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM tchap/centos-epel | |
| RUN yum install -y git | |
| RUN yum install -y cronie | |
| RUN yum install -y ruby-rdoc rubygems | |
| ### rpmforge.repo is needed only for installing puppet 2.7. | |
| #ADD ./misc/rpmforge.repo /etc/yum.repos.d/rpmforge.repo | |
| #RUN yum install -y puppet | |
| #RUN rm /etc/yum.repos.d/rpmforge.repo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Inject docker-init | |
| lxc.mount.entry = /usr/bin/docker /var/lib/docker/containers/e12a1202785b9b676be68d330566b7674278be9798ea392c2037de3d2d570bed/rootfs/.dockerinit none bind,ro 0 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sep 9 12:39:28 ab7a8adc9a2e sshd[299]: Accepted password for root from 172.16.42.1 port 34479 ssh2 | |
| Sep 9 12:39:28 ab7a8adc9a2e sshd[299]: pam_loginuid(sshd:session): set_loginuid failed | |
| Sep 9 12:39:28 ab7a8adc9a2e sshd[299]: pam_unix(sshd:session): session opened for user root by (uid=0) | |
| Sep 9 12:39:28 ab7a8adc9a2e sshd[299]: error: PAM: pam_open_session(): Cannot make/remove an entry for the specified session | |
| Sep 9 12:39:28 ab7a8adc9a2e sshd[299]: Received disconnect from 172.16.42.1: 11: disconnected by user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| num_res = 20 | |
| times = [] | |
| IO.foreach('/var/log/messages') { |line| | |
| if line =~ /puppet-apply\[\d+\]: \(.*([A-Z][^\[]+)\[(.+?)\]\) Evaluated in ([\d\.]+) seconds$/ | |
| type = $1 | |
| title = $2 | |
| time = $3.to_f |