This repository has been archived by the owner on Apr 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
87 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,33 @@ | |||
#!/usr/bin/env perl | |||
|
|||
use strict; | |||
use warnings; | |||
use Cinnamon::DSL; | |||
|
|||
role local => [qw(local.prepan.org)], { | |||
user => 'vagrant', | |||
}; | |||
|
|||
role redis => [qw(redis-1.us-west-1)], { | |||
user => 'ec2-user', | |||
}; | |||
|
|||
role app => [qw(app-1.us-west-1 app-2.us-west-1)], { | |||
user => 'ec2-user', | |||
}; | |||
|
|||
task chef => { | |||
prepare => sub { | |||
my ($host, @args) = @_; | |||
my $user = get('user'); | |||
|
|||
run "knife", "solo", "prepare", "$user\@$host", "-c", "config/knife.rb", "-i", "~/.ssh/prepan.pem", "-F", "~/.ssh/config" | |||
}, | |||
|
|||
cook => sub { | |||
my ($host, @args) = @_; | |||
my $user = get('user'); | |||
|
|||
run "knife", "solo", "cook", "$user\@$host", "-c", "config/knife.rb", "-i", "~/.ssh/prepan.pem", "-F", "~/.ssh/config" | |||
}, | |||
}; |
This file contains 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,15 @@ | |||
{ | |||
"run_list": [ | |||
"role[app]" | |||
], | |||
|
|||
"app": { | |||
"domain": "prepan.org" | |||
}, | |||
|
|||
"authorization": { | |||
"sudo": { | |||
"users": ["ec2-user", "deployer"] | |||
} | |||
} | |||
} |
This file contains 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,15 @@ | |||
{ | |||
"run_list": [ | |||
"role[app]" | |||
], | |||
|
|||
"app": { | |||
"domain": "prepan.org" | |||
}, | |||
|
|||
"authorization": { | |||
"sudo": { | |||
"users": ["ec2-user", "deployer"] | |||
} | |||
} | |||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,24 +1,16 @@ | |||
package "perl-CPAN" do | |||
notifies :run, "execute[install cpanm]" | |||
not_if { system('which cpan') } | |||
end | |||
|
|||
execute "install cpanm" do | execute "install cpanm" do | ||
command "cpan App::cpanminus" | command "curl -L http://cpanmin.us | perl - --self-upgrade" | ||
notifies :run, "execute[install modules]" | |||
not_if { system('which cpanm') } | not_if { system('which cpanm') } | ||
end | end | ||
|
|
||
execute "install modules" do | [ | ||
[ | 'Module::Install', | ||
'Module::Install', | 'Module::Install::CPANfile', | ||
'Module::Install::CPANfile', | 'Module::Install::ReadmeFromPod', | ||
'Module::Install::ReadmeFromPod', | 'Module::Install::Repository', | ||
'Module::Install::Repository', | 'git://github.com/miyagawa/carton.git', | ||
'git://github.com/miyagawa/carton.git', | ].each do |name| | ||
].each do |name| | execute "install #{name}" do | ||
command "cpanm #{name}" | command "cpanm -n -f #{name}" | ||
end | end | ||
|
|||
not_if { system('which carton') } | |||
end | end |
This file contains 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,3 +1,3 @@ | |||
package "perl" do | package "perl" do | ||
notifies :run, "package[perl-CPAN]" | notifies :run, "execute[install cpanm]" | ||
end | end |