space, → | next slide |
← | previous slide |
d | debug mode |
## <ret> | go to slide # |
c | table of contents (vi) |
f | toggle footer |
r | reload slides |
z | toggle help (this) |
apt-get install gcc
package { "gcc": ensure => installed }
/etc
and /usr/local
.root
access, so use it.$ echo "deb http://packages.devstructure.com lucid main" | sudo tee /etc/apt/sources.list.d/devstructure.list $ sudo wget -O /etc/apt/trusted.gpg.d/devstructure.gpg \ http://packages.devstructure.com/keyring.gpg $ sudo apt-get update ... $ sudo apt-get -y install blueprint ... $ blueprint Usage: blueprint <command> [...] Common commands: list, create, show, diff, apply, destroy, git $
blueprint create foo
$ sudo blueprint create foo # [blueprint] searching for APT packages to exclude # [blueprint] caching excluded APT packages # [blueprint] searching for Yum packages to exclude # [blueprint] parsing ~/.blueprintignore # [blueprint] searching for Yum packages # [blueprint] searching for APT packages # [blueprint] searching for Python packages # [blueprint] searching for PEAR/PECL packages # [blueprint] searching for Ruby gems # [blueprint] searching for configuration files # [blueprint] searching for software built from source # [blueprint] searching for service dependencies $
/etc
../configure && make && make install
blueprint show foo | less
{ "files": { "/etc/apt/sources.list.d/devstructure.list": { "content": "deb http://packages.devstructure.com natty main\n", "encoding": "plain", "group": "root", "mode": "100644", "owner": "root" } }, "packages": { "apt": { "openssh-server": ["1:5.8p1-1ubuntu3"], } }, "services": { "sysvinit": { "ssh": { "packages": { "apt": ["openssh-server"] } } } } }
~/.blueprintignore
gitignore
(5).$ cat ~/.blueprintignore /etc/apt !/etc/apt/sources.list.d !/etc/apt/trusted.gpg.d *.pyc /etc/hosts /etc/nginx/sites-enabled/default /etc/sudoers :package:apt/build-essential !:package:apt/build-essential :package:apt/libopts25 :package:apt/libtspi1 $ sudo blueprint create foo ... $
blueprint push foo
blueprint pull foo
blueprint apply foo
blueprint show -S foo
foo.sh
without installing Blueprint.blueprint show -P foo
blueprint show -C foo
class foo { Class['files'] -> Class['packages'] class files { file { '/etc/apt/sources.list.d/devstructure.list': content => template('foo/etc/apt/sources.list.d/devstructure.list'), ensure => file, group => root, mode => 0644, owner => root; } } include files class packages { class apt { package { 'openssh-server': ensure => '1:5.8p1-1ubuntu3'; } } include apt } include packages class services { class sysvinit { service { 'ssh': enable => true, ensure => running, subscribe => Package['openssh-server'], } } include sysvinit } include services }
cookbook_file('/etc/apt/sources.list.d/devstructure.list') do backup false group 'root' mode '0644' owner 'root' source 'etc/apt/sources.list.d/devstructure.list' end package('openssh-server') { version '1:5.8p1-1ubuntu3' } service('ssh') do action [:enable, :start] subscribes :restart, resources('package[openssh-server]') end
cron
(8).0 * * * * curl https://devstructure.com/secret/foo/foo.sh | sh
#!/bin/sh set -e TMPDIR="$(mktemp -d)" cd "$TMPDIR" trap "rm -rf \"$TMPDIR\"" EXIT wget "http://devstructure.com/secret/foo/foo.sh" sh "$(ls)"
systemd
.