cristifalcas / puppet-etcd

etcd is a distributed key value store that provides a reliable way to store data across a cluster of machines.
https://coreos.com/etcd/
Apache License 2.0
9 stars 39 forks source link

Adjustment on directory creation to work with Ubuntu distribution #32

Closed ngoduykhanh closed 6 years ago

ngoduykhanh commented 6 years ago

As my report in issue #31. It looks like the current module doesn't work with Ubuntu. Also, on ubuntu, the default configuration file for etc should be /etc/default/etcd as following systemd file

cat /lib/systemd/system/etcd.service
[Unit]
Description=etcd - highly-available key value store
Documentation=https://github.com/coreos/etcd
Documentation=man:etcd
After=network.target
Wants=network-online.target

[Service]
Environment=DAEMON_ARGS=
Environment=ETCD_NAME=%H
Environment=ETCD_DATA_DIR=/var/lib/etcd/default
EnvironmentFile=-/etc/default/%p
Type=notify
User=etcd
PermissionsStartOnly=true
#ExecStart=/bin/sh -c "GOMAXPROCS=$(nproc) /usr/bin/etcd $DAEMON_ARGS"
ExecStart=/usr/bin/etcd $DAEMON_ARGS
Restart=on-abnormal
#RestartSec=10s
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target
Alias=etcd2.service
cristifalcas commented 6 years ago

Are you sure you want to create /etc/etcd and not /etc/default/etcd?

Also, isn't this dir supposed to be created by the package?

Anyway, let me know if you actually want /etc/etcd and I will merge it

cristifalcas commented 6 years ago

And thank you @ngoduykhanh for your contribution

ngoduykhanh commented 6 years ago

Hi,

Sorry for late response. /etc/default/etcd is automatically created by the package itself, but /etc/etcd not. I am not sure whether /etc/etcd is being used by etcd pacakge in ubuntu, but with this code, the puppet module is trying to create a file in non-existing directory.

cristifalcas commented 6 years ago

Sorry for the delay