init
This commit is contained in:
commit
667ada2402
|
@ -0,0 +1,16 @@
|
|||
Terraform module to replace syslogd with rsyslog
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
In the root terraform add::
|
||||
|
||||
module "rsyslog" {
|
||||
source = "git::https://git.dalembert.upmc.fr/terraform/module_alpine_rsyslog"
|
||||
connection_ip = var.eth0_ip
|
||||
connection_private_key = file(var.pm_private_key)
|
||||
}
|
||||
|
||||
|
||||
.. vim: spelllang=en:
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
|
||||
resource "null_resource" "rsyslog" {
|
||||
connection {
|
||||
type = "ssh"
|
||||
user = "root"
|
||||
host = var.connection_ip
|
||||
private_key = var.connection_private_key
|
||||
}
|
||||
|
||||
provisioner "file" {
|
||||
source = "${path.module}/rsyslog.conf"
|
||||
destination = "/tmp/rsyslog.conf"
|
||||
}
|
||||
|
||||
# execute postinstall script
|
||||
provisioner "remote-exec" {
|
||||
inline = [
|
||||
"echo '# install rsyslog'",
|
||||
"apk add --no-cache rsyslog",
|
||||
#
|
||||
"echo '# disable service syslog'",
|
||||
"rc-service syslog stop",
|
||||
"rc-update del syslog",
|
||||
"rc-update del syslog boot",
|
||||
#
|
||||
"echo '# configuration service rsyslog'",
|
||||
"rc-service rsyslog stop",
|
||||
"mv /tmp/rsyslog.conf /etc/rsyslog.conf",
|
||||
"rc-service rsyslog start",
|
||||
"rc-update add rsyslog boot",
|
||||
#
|
||||
"echo;echo '# VM must be restarted to clean syslogd'",
|
||||
]
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
rsyslogd -f /etc/rsyslog.conf -N1
|
|
@ -0,0 +1,7 @@
|
|||
if rsyslogd-checkconf
|
||||
then
|
||||
echo "Config OK"
|
||||
rc-service rsyslog restart
|
||||
else
|
||||
echo "Abort restarting"
|
||||
fi
|
|
@ -0,0 +1,11 @@
|
|||
variable "connection_ip" {
|
||||
type = string
|
||||
description = "ipv4"
|
||||
}
|
||||
|
||||
variable "connection_private_key" {
|
||||
type = string
|
||||
description = "private key for terraform connection"
|
||||
sensitive = true
|
||||
}
|
||||
|
Loading…
Reference in New Issue