Skip to content

Commit

Permalink
Updating packaging files for salt-ssh and upstart/logrotate
Browse files Browse the repository at this point in the history
  • Loading branch information
QuinnyPig committed Nov 17, 2013
1 parent 6f45108 commit 9e402e6
Show file tree
Hide file tree
Showing 14 changed files with 351 additions and 0 deletions.
28 changes: 28 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,34 @@ Description: This package represents the master-of-masters for salt
This particular package provides the master of masters for salt-- it enables
the management of multiple masters at a time..

Package: salt-ssh
Architecture: all
Depends: ${misc:Depends},
${python:Depends},
salt-common (= ${source:Version}),
sshpass
Description: remote manager to administer servers via salt
salt is a powerful remote execution manager that can be used to
administer servers in a fast and efficient way.
.
It allows commands to be executed across large groups of
servers. This means systems can be easily managed, but data can
also be easily gathered. Quick introspection into running
systems becomes a reality.
.
Remote execution is usually used to set up a certain state on a
remote system. Salt addresses this problem as well, the salt
state system uses salt state files to define the state a server
needs to be in.
.
Between the remote execution system, and state management Salt
addresses the backbone of cloud and data center management.
.
This particular package provides the salt ssh controller. It
is able to run salt modules and states on remote hosts via ssh.
No minion or other salt specific software needs to be installed
on the remote host.

Package: salt-doc
Architecture: all
Section: doc
Expand Down
23 changes: 23 additions & 0 deletions debian/salt-common.logrotate
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/var/log/salt/master {
weekly
missingok
rotate 7
compress
notifempty
}

/var/log/salt/minion {
weekly
missingok
rotate 7
compress
notifempty
}

/var/log/salt/key {
weekly
missingok
rotate 7
compress
notifempty
}
55 changes: 55 additions & 0 deletions debian/salt-common.postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/sh -e
# Purge config files, logs, and directories created after package install.
# Note that user-specified alternate locations for these are not affected.
#
# rename to salt-'common|master|minion|syndic'.postrm and call with "purge"

clean_common() {
# remove shared job cache and other runtime directories
rm -rf \
/var/cache/salt \
/var/log/salt \
/var/run/salt \
2> /dev/null
}

clean_conf() {
# remove config and log file for master, minion, or syndic
rm -rf \
/etc/salt/pki/$1 \
/var/cache/salt/$1 \
/var/log/salt/$1 \
/var/run/salt/$1 \
2> /dev/null
}

purgefiles() {
case "$pkg" in
master|minion|syndic)
clean_conf $pkg ;;
common)
clean_common ;;
*)
echo "$0 unknown package \`$1'" 1>&2
exit 1 ;;
esac
}

pkg=`echo $0 | cut -f1 -d. | cut -f2 -d-`

case "$1" in
remove)
;;
purge)
purgefiles
;;
upgrade|failed-upgrade|disappear|abort-install|abort-upgrade)
;;
*)
echo "$0 unknown action \`$1'" 1>&2
exit 1 ;;
esac

# This tag is required:
#DEBHELPER#
exit 0
55 changes: 55 additions & 0 deletions debian/salt-master.postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/sh -e
# Purge config files, logs, and directories created after package install.
# Note that user-specified alternate locations for these are not affected.
#
# rename to salt-'common|master|minion|syndic'.postrm and call with "purge"

clean_common() {
# remove shared job cache and other runtime directories
rm -rf \
/var/cache/salt \
/var/log/salt \
/var/run/salt \
2> /dev/null
}

clean_conf() {
# remove config and log file for master, minion, or syndic
rm -rf \
/etc/salt/pki/$1 \
/var/cache/salt/$1 \
/var/log/salt/$1 \
/var/run/salt/$1 \
2> /dev/null
}

purgefiles() {
case "$pkg" in
master|minion|syndic)
clean_conf $pkg ;;
common)
clean_common ;;
*)
echo "$0 unknown package \`$1'" 1>&2
exit 1 ;;
esac
}

pkg=`echo $0 | cut -f1 -d. | cut -f2 -d-`

case "$1" in
remove)
;;
purge)
purgefiles
;;
upgrade|failed-upgrade|disappear|abort-install|abort-upgrade)
;;
*)
echo "$0 unknown action \`$1'" 1>&2
exit 1 ;;
esac

# This tag is required:
#DEBHELPER#
exit 0
10 changes: 10 additions & 0 deletions debian/salt-master.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=The Salt Master Server
After=syslog.target network.target

[Service]
Type=simple
ExecStart=/usr/bin/salt-master

[Install]
WantedBy=multi-user.target
14 changes: 14 additions & 0 deletions debian/salt-master.upstart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
description "Salt Master"

start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [!2345]
limit nofile 100000 100000

script
# Read configuration variable file if it is present
[ -f /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB

exec salt-master
end script
55 changes: 55 additions & 0 deletions debian/salt-minion.postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/sh -e
# Purge config files, logs, and directories created after package install.
# Note that user-specified alternate locations for these are not affected.
#
# rename to salt-'common|master|minion|syndic'.postrm and call with "purge"

clean_common() {
# remove shared job cache and other runtime directories
rm -rf \
/var/cache/salt \
/var/log/salt \
/var/run/salt \
2> /dev/null
}

clean_conf() {
# remove config and log file for master, minion, or syndic
rm -rf \
/etc/salt/pki/$1 \
/var/cache/salt/$1 \
/var/log/salt/$1 \
/var/run/salt/$1 \
2> /dev/null
}

purgefiles() {
case "$pkg" in
master|minion|syndic)
clean_conf $pkg ;;
common)
clean_common ;;
*)
echo "$0 unknown package \`$1'" 1>&2
exit 1 ;;
esac
}

pkg=`echo $0 | cut -f1 -d. | cut -f2 -d-`

case "$1" in
remove)
;;
purge)
purgefiles
;;
upgrade|failed-upgrade|disappear|abort-install|abort-upgrade)
;;
*)
echo "$0 unknown action \`$1'" 1>&2
exit 1 ;;
esac

# This tag is required:
#DEBHELPER#
exit 0
10 changes: 10 additions & 0 deletions debian/salt-minion.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=The Salt Minion
After=syslog.target network.target

[Service]
Type=simple
ExecStart=/usr/bin/salt-minion

[Install]
WantedBy=multi-user.target
20 changes: 20 additions & 0 deletions debian/salt-minion.upstart
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
description "Salt Minion"

start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [!2345]

# The respawn in the minion is known to cause problems
# because if the main minion process dies it has done
# so most likely for a good reason. Uncomment these
# two lines to enable respawn
#respawn
#respawn limit 10 5

script
# Read configuration variable file if it is present
[ -f /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB

exec salt-minion
end script
2 changes: 2 additions & 0 deletions debian/salt-ssh.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
usr/bin/salt-ssh
conf/roster /etc/salt
1 change: 1 addition & 0 deletions debian/salt-ssh.manpages
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
doc/man/salt-ssh.1
55 changes: 55 additions & 0 deletions debian/salt-syndic.postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/sh -e
# Purge config files, logs, and directories created after package install.
# Note that user-specified alternate locations for these are not affected.
#
# rename to salt-'common|master|minion|syndic'.postrm and call with "purge"

clean_common() {
# remove shared job cache and other runtime directories
rm -rf \
/var/cache/salt \
/var/log/salt \
/var/run/salt \
2> /dev/null
}

clean_conf() {
# remove config and log file for master, minion, or syndic
rm -rf \
/etc/salt/pki/$1 \
/var/cache/salt/$1 \
/var/log/salt/$1 \
/var/run/salt/$1 \
2> /dev/null
}

purgefiles() {
case "$pkg" in
master|minion|syndic)
clean_conf $pkg ;;
common)
clean_common ;;
*)
echo "$0 unknown package \`$1'" 1>&2
exit 1 ;;
esac
}

pkg=`echo $0 | cut -f1 -d. | cut -f2 -d-`

case "$1" in
remove)
;;
purge)
purgefiles
;;
upgrade|failed-upgrade|disappear|abort-install|abort-upgrade)
;;
*)
echo "$0 unknown action \`$1'" 1>&2
exit 1 ;;
esac

# This tag is required:
#DEBHELPER#
exit 0
10 changes: 10 additions & 0 deletions debian/salt-syndic.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=The Salt Master Server
After=syslog.target network.target

[Service]
Type=simple
ExecStart=/usr/bin/salt-syndic

[Install]
WantedBy=multi-user.target
13 changes: 13 additions & 0 deletions debian/salt-syndic.upstart
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
description "salt-syndic"

start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [!2345]

script
# Read configuration variable file if it is present
[ -f /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB

exec salt-syndic
end script

0 comments on commit 9e402e6

Please sign in to comment.