2015-04-01 16:24:07 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
RSYSLOGD_CONF="$(dirname $0)/rsyslog/rsyslog.conf"
|
|
|
|
RSYSLOGD_FILE="/etc/rsyslog.conf"
|
2016-07-25 14:41:46 +02:00
|
|
|
RSYSLOGD_SYSLOG_CONF="$(dirname $0)/rsyslog/99syslog.conf"
|
2016-07-25 14:42:56 +02:00
|
|
|
RSYSLOGD_SYSLOG_FILE="/etc/rsyslog.d/99syslog.conf"
|
2015-04-01 16:24:07 +02:00
|
|
|
|
|
|
|
LOGROTATE_CONF="$(dirname $0)/logrotate/logrotate.conf"
|
|
|
|
LOGROTATE_FILE="/etc/logrotate.conf"
|
|
|
|
LOGROTATE_SYSLOG_CONF="$(dirname $0)/logrotate/rsyslog"
|
|
|
|
LOGROTATE_SYSLOG_FILE="/etc/logrotate.d/rsyslog"
|
|
|
|
LOGROTATE_APTITUDE_CONF="$(dirname $0)/logrotate/aptitude"
|
|
|
|
LOGROTATE_APTITUDE_FILE="/etc/logrotate.d/aptitude"
|
|
|
|
LOGROTATE_DPKG_CONF="$(dirname $0)/logrotate/dpkg"
|
|
|
|
LOGROTATE_DPKG_FILE="/etc/logrotate.d/dpkg"
|
|
|
|
|
2017-12-06 15:52:51 +01:00
|
|
|
## Packages {{{
|
|
|
|
# Ensure to have some basic packages
|
|
|
|
apt -y install aptitude tmux zsh
|
|
|
|
|
|
|
|
# Remove NFS and rpcbind
|
|
|
|
aptitude -y remove nfs-common rpcbind
|
|
|
|
|
2017-12-08 16:17:05 +01:00
|
|
|
### Documentation {{{
|
|
|
|
# Remove task-french
|
|
|
|
if [ "$(dpkg -l task-french)" ]; then
|
|
|
|
# Move default wordlist to american before remove all packages
|
|
|
|
select-default-wordlist --set-default=american
|
|
|
|
aptitude -y remove task-french
|
|
|
|
|
|
|
|
# Reinstall useful french doc and move back to french dict
|
|
|
|
aptitude -y install aspell-fr doc-debian-fr doc-linux-fr-text ifrench-gut manpages-fr manpages-fr-extra wfrench
|
|
|
|
select-default-wordlist --set-default=".*(F|f)rench.*"
|
|
|
|
fi
|
|
|
|
|
2017-12-08 16:18:17 +01:00
|
|
|
# Remove task-english
|
|
|
|
if [ "$(dpkg -l task-english)" ]; then
|
|
|
|
aptitude -y remove task-english
|
|
|
|
fi
|
|
|
|
|
2017-12-08 16:20:39 +01:00
|
|
|
# Ensure to have minimal documentation
|
|
|
|
aptitude -y install man-db manpages
|
|
|
|
|
2017-12-08 16:17:05 +01:00
|
|
|
### }}}
|
|
|
|
|
2017-12-08 16:06:42 +01:00
|
|
|
### SSH {{{
|
|
|
|
# Remove task-ssh-server
|
|
|
|
if [ "$(dpkg -l task-ssh-server)" ]; then
|
|
|
|
aptitude -y remove task-ssh-server
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Ensure to install openssh-server
|
2017-12-06 15:52:51 +01:00
|
|
|
aptitude -y install openssh-server openssh-sftp-server
|
|
|
|
|
2017-12-08 16:06:42 +01:00
|
|
|
### }}}
|
|
|
|
|
2017-12-06 15:52:51 +01:00
|
|
|
# Ansible dependencies
|
|
|
|
aptitude -y install python-apt
|
|
|
|
|
|
|
|
## }}}
|
|
|
|
|
|
|
|
### Rsyslog {{{
|
2015-04-01 16:24:07 +02:00
|
|
|
|
|
|
|
# Install new Rsyslog configuration
|
|
|
|
if [ -f "${RSYSLOGD_FILE}" ]; then
|
|
|
|
cp "${RSYSLOGD_CONF}" "${RSYSLOGD_FILE}"
|
|
|
|
fi
|
|
|
|
cp "${RSYSLOGD_SYSLOG_CONF}" "${RSYSLOGD_SYSLOG_FILE}"
|
|
|
|
|
|
|
|
# Restart Rsyslog service
|
2017-09-06 10:22:14 +02:00
|
|
|
systemctl restart rsyslog
|
2015-04-01 16:24:07 +02:00
|
|
|
|
2017-12-06 15:52:51 +01:00
|
|
|
### }}}
|
|
|
|
|
2017-08-20 15:51:14 +02:00
|
|
|
### Logrotate {{{
|
2015-04-01 16:24:07 +02:00
|
|
|
|
|
|
|
# Install new Logrotate configuration
|
|
|
|
if [ -f "${LOGROTATE_FILE}" ]; then
|
|
|
|
cp "${LOGROTATE_CONF}" "${LOGROTATE_FILE}"
|
|
|
|
fi
|
|
|
|
cp "${LOGROTATE_SYSLOG_CONF}" "${LOGROTATE_SYSLOG_FILE}"
|
|
|
|
cp "${LOGROTATE_APTITUDE_CONF}" "${LOGROTATE_APTITUDE_FILE}"
|
|
|
|
cp "${LOGROTATE_DPKG_CONF}" "${LOGROTATE_DPKG_FILE}"
|
|
|
|
|
2017-08-20 16:07:26 +02:00
|
|
|
# Create an archive directory for some log files (aptitude, dpkg,…)
|
2017-09-11 11:05:17 +02:00
|
|
|
mkdir -p -- /var/log/old_logs /var/log/aptitude.d /var/log/dpkg /var/log/alternatives /var/log/syslog.d /var/log/cron /var/log/daemon /var/log/kern /var/log/lpr /var/log/mail /var/log/auth /var/log/messages.d
|
2017-09-05 17:04:52 +02:00
|
|
|
|
2017-09-11 11:05:17 +02:00
|
|
|
chmod 0750 /var/log/auth /var/log/daemon /var/log/kern /var/log/messages.d /var/log/syslog.d
|
|
|
|
chown root:adm /var/log/auth /var/log/daemon /var/log/kern /var/log/messages.d /var/log/syslog.d
|
2015-04-01 16:24:07 +02:00
|
|
|
|
2015-04-30 14:09:32 +02:00
|
|
|
# Create the log directory for journald (Systemd), need the configuration Storage=(auto|persistent)
|
|
|
|
mkdir -p -- /var/log/journal
|
2017-08-20 16:07:26 +02:00
|
|
|
### }}}
|
|
|
|
|
2017-08-20 15:51:14 +02:00
|
|
|
exit 0
|