forked from ripienaar/mcollective-server-provisioner
-
Notifications
You must be signed in to change notification settings - Fork 1
/
mcprovision.spec
85 lines (70 loc) · 2.44 KB
/
mcprovision.spec
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
%define ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")
%define release %{rpm_release}%{?dist}
Summary: Server Provisioner for Puppet and MCollective
Name: mcprovision
Version: %{version}
Release: %{release}
Group: System Tools
License: Apache v2
URL: http://www.devco.net/
Source0: %{name}-%{version}.tgz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: ruby
Requires: mcollective-client
Packager: R.I.Pienaar <[email protected]>
BuildArch: noarch
%package agent
Summary: MCollective Provisioner Agent
Group: System Tools
Requires: ruby
Requires: mcollective
%description
Automated the provisioning of servers in a Puppet environment via MCollective
%description agent
Agent providing services for the MCollective Server Provisioner
%prep
%setup -q
%build
%install
rm -rf %{buildroot}
%{__install} -d -m0755 %{buildroot}/%{ruby_sitelib}/mcprovision
%{__install} -d -m0755 %{buildroot}/etc/mcollective
%{__install} -d -m0755 %{buildroot}/usr/sbin
%{__install} -d -m0755 %{buildroot}/etc/init.d
%{__install} -d -m0755 %{buildroot}/etc/sysconfig
%{__install} -d -m0755 %{buildroot}/usr/libexec/mcollective/mcollective/agent
%{__install} -m0755 mcprovision.rb %{buildroot}/usr/sbin/mcprovision
%{__install} -m0755 mcprovision.init %{buildroot}/etc/init.d/mcprovision
%{__install} -m0644 etc/provisioner.yaml.dist %{buildroot}/etc/mcollective/mcprovision.yaml
%{__install} -m0644 agent/provision.ddl %{buildroot}/usr/libexec/mcollective/mcollective/agent/provision.ddl
%{__install} -m0644 agent/provision.rb %{buildroot}/usr/libexec/mcollective/mcollective/agent/provision.rb
%{__install} -m0600 etc/mcprovision.defaults %{buildroot}/etc/sysconfig/mcprovision
cp -R lib/* %{buildroot}/%{ruby_sitelib}/
%clean
rm -rf %{buildroot}
%post
/sbin/chkconfig --add mcprovision
%preun
if [ "$1" = 0 ]; then
/sbin/service mcprovision stop >/dev/null 2>&1 || :;
/sbin/chkconfig --del mcprovision || :;
fi
:;
%postun
if [ "$1" -ge 1 ]; then
/sbin/service mcprovision condrestart >/dev/null 2>&1 || :;
fi;
:;
%files agent
/usr/libexec/mcollective/mcollective/agent/provision.rb
%files
%{ruby_sitelib}/mcprovision.rb
%{ruby_sitelib}/mcprovision
%config(noreplace) /etc/mcollective/mcprovision.yaml
%config(noreplace) /etc/sysconfig/mcprovision
/etc/init.d/mcprovision
/usr/sbin/mcprovision
/usr/libexec/mcollective/mcollective/agent/provision.ddl
%changelog
* Thu Feb 11 2011 R.I.Pienaar <[email protected]> - 1.0.0
- First release