Skip to content

Commit

Permalink
Merge pull request #19 from jordiprats/master
Browse files Browse the repository at this point in the history
systemd 0.2
  • Loading branch information
jordiprats authored May 2, 2019
2 parents 210775d + 63a024a commit dda9f14
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 0.1.14

* Updated metadata for **eyp-systemd 0.2.0**

## 0.1.13

* added support for SLES 12.4
Expand Down
6 changes: 3 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "eyp-ntp",
"version": "0.1.13",
"version": "0.1.14",
"author": "eyp",
"summary": "Installs, configures, and manages the NTP service",
"license": "Apache-2.0",
"source": "https://github.com/NTTCom-MS/eyp-ntp",
"project_page": "https://github.com/NTTCom-MS/eyp-ntp",
"issues_url": "https://github.com/NTTCom-MS/eyp-ntp/issues",
"dependencies": [
{"name":"puppetlabs/stdlib","version_requirement":">= 1.0.0"},
{"name":"eyp/systemd","version_requirement":">= 0.1.44 < 0.2.0"},
{"name":"puppetlabs/stdlib","version_requirement":">= 1.0.0 < 9.9.9"},
{"name":"eyp/systemd","version_requirement":">= 0.1.44 < 0.3.0"},
{"name":"eyp/eyplib","version_requirement":">= 0.1.0 < 0.2.0"}
],
"operatingsystem_support": [
Expand Down
12 changes: 12 additions & 0 deletions tasks/forcesync.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"puppet_task_version": 1,
"supports_noop": false,
"input_method": "stdin",
"description": "force NTP update",
"parameters": {
"ntpserver": {
"description": "NTP server to use",
"type": "String[1]"
}
}
}
21 changes: 21 additions & 0 deletions tasks/forcesync.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/python

import sys
import json
from pprint import pprint
import subprocess

params = json.load(sys.stdin)

ntpserver = params['ntpserver']

# puppet resource service ntp ensure=stopped

result={}
result['forcesync']={}
result['forcesync']['server']=ntpserver
result['forcesync']['output']=subprocess.check_output("ntpdate "+ntpserver, shell=True)

# puppet resource service ntp ensure=running

print(json.dumps(result))

0 comments on commit dda9f14

Please sign in to comment.