Skip to content
This repository has been archived by the owner on Jun 11, 2019. It is now read-only.

suse init scripts test for validity of keys #28

Open
pearcec opened this issue Dec 30, 2014 · 2 comments
Open

suse init scripts test for validity of keys #28

pearcec opened this issue Dec 30, 2014 · 2 comments

Comments

@pearcec
Copy link

pearcec commented Dec 30, 2014

Error from puppet

change from stopped to running failed: Could not start Service[ntp]: Execution of '/sbin/service ntp start' returned 5: NTP key id not defined..skipped

If keys is defined it checks for requestkey to be defined. It also checks the key file for the existence of the id.

Here is a snip of the code

NTP_KEYS=$(awk '/^keys/ { print $2 }' $NTP_CONF)
NTP_KEYID=$(awk '/^requestkey[[:blank:]]/ { print $2 }' $NTP_CONF)
NTP_PASSWD=$(test -n "$NTP_KEYS" -a -n "$NTP_KEYID" -a -r "$NTP_KEYS" && awk '$0 ~ key { print $3 }'
 key="^[[:blank:]]*$NTP_KEYID[[:blank:]]" $NTP_KEYS)

if [ -n "$NTP_KEYS" ]; then
  if test -z "$NTP_KEYID"; then
    echo -n "NTP key id not defined"
      rc_status -s
      exit 5
  fi
  if test -z "$NTP_PASSWD"; then
    echo -n "No password for requestkey set"
    exit 1
  fi
fi
@alvagante
Copy link
Member

I suppose we should provide a custom ntp.conf template for Suse and populate it with keys, whose value should be exposed by a parameter in the class , or, alternatively, you can try to provide the values for the params key_file and key_file_source if they can stay on separated files.
FYI, I'm not going to maintain actively this module (it will be replaced by https://github.com/example42/puppet-tp), if you want and feel like you can do that you can ask to maintain it.

@pearcec
Copy link
Author

pearcec commented Jan 3, 2015

Yes that would make sense. I would not limit it to SuSE. Anyone can use
it. It just so happens SuSE has a validation it does during startup. A
bit over engineered IMO.

On Wed, Dec 31, 2014 at 3:31 AM, Alessandro Franceschi <
[email protected]> wrote:

I suppose we should provide a custom ntp.conf template for Suse and
populate it with keys, whose value should be exposed by a parameter in the
class , or, alternatively, you can try to provide the values for the params
key_file and key_file_source if they can stay on separated files.
FYI, I'm not going to maintain actively this module (it will be replaced
by https://github.com/example42/puppet-tp), if you want and feel like you
can do that you can ask to maintain it.

Reply to this email directly or view it on GitHub
#28 (comment).

Christian

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants