forked from MattR-Joyent/sup-notify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsup.pp
137 lines (114 loc) · 3.17 KB
/
sup.pp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
file { "/root/.ssh/config":
ensure => file,
owner => "root",
group => "root",
mode => "0600",
source => "/root/sup/ssh-config",
}
file { "/root/.bash_profile":
ensure => file,
owner => "root",
group => "root",
mode => "0600",
source => "/root/sup/.bash_profile",
}
file { "/opt/local/etc/postfix/main.cf":
ensure => file,
owner => "root",
group => "root",
mode => "0600",
source => "/root/sup/main.cf",
before => Service["postfix"],
}
file { "/opt/local/lib/node_modules/sup-notify/etc":
ensure => directory,
owner => "root",
group => "root",
mode => "0644",
require => Exec["install-sup-notify"],
}
file { "/opt/local/lib/node_modules/im-notices/etc":
ensure => directory,
owner => "root",
group => "root",
mode => "0644",
require => Exec["install-im-notices"],
}
service { "postfix":
ensure => running,
}
package { "gcc49":
ensure => installed,
before => Package["nodejs"],
}
package { "gmake":
ensure => installed,
before => Package["nodejs"],
}
exec { "remove-nodejs":
command => "/opt/local/bin/pkgin -y rm nodejs",
unless => "/usr/bin/test ! -f /opt/local/bin/node || /opt/local/bin/node --version | grep -q v0.10.48",
}
package { "nodejs":
ensure => "0.10.48",
require => Exec["remove-nodejs"],
before => [ Package["manta"], Exec["install-sup-notify"], Exec["install-toolbox"], Exec["install-im-notices"], Exec["install-new-ufds-users"] ],
}
package { "p5-libwww":
ensure => installed,
}
package { "p5-JSON":
ensure => installed,
}
package { "p5-App-cpanminus":
require => Package["gmake"],
ensure => installed,
}
package { "manta":
ensure => present,
provider => "npm",
}
package { "mosh":
ensure => present,
}
exec { "install-sup-notify":
require => [ Package["gcc49"], Package["gmake"] ],
command => "/root/sup/npm_from_git.sh https://github.com/joyent/sup-notify.git",
}
exec { "install-sup-notify-templates":
command => "/opt/local/bin/git clone git+ssh://[email protected]/joyent/triton-cloud-notification-templates.git",
unless => "/usr/bin/test -d /opt/local/lib/triton-cloud-notification-templates",
cwd => "/opt/local/lib",
}
exec { "update-sup-notify-templates":
command => "/opt/local/bin/git pull",
unless => "/usr/bin/test ! -d /opt/local/lib/triton-cloud-notification-templates",
cwd => "/opt/local/lib/triton-cloud-notification-templates",
}
exec { "install-toolbox":
require => [ Package["gcc49"], Package["gmake"] ],
command => "/root/sup/npm_from_git.sh https://github.com/joyent/sup-toolbox.git",
timeout => 600,
}
exec { "install-im-notices":
require => [ Package["gcc49"], Package["gmake"] ],
command => "/root/sup/npm_from_git.sh https://github.com/joyent/sup-im-notices.git",
}
cpanm { "JIRA::REST":
require => Package["p5-App-cpanminus"],
ensure => installed,
}
exec { "install-new-ufds-users":
require => [ Package["gcc49"], Package["gmake"] ],
command => "/root/sup/npm_from_git.sh https://github.com/joyent/sup-new-ufds-users.git",
}
cron { "refresh-from-git":
command => "cd /root/sup ; /opt/local/bin/git pull",
user => "root",
minute => 0,
}
cron { "reapply-sup":
command => "/opt/local/bin/puppet apply /root/sup/sup.pp",
user => "root",
minute => 30,
}