2011-06-16 21:37:52 +00:00
|
|
|
import logging
|
|
|
|
|
2011-09-13 21:53:02 +00:00
|
|
|
from ..orchestra import run
|
2011-06-16 21:37:52 +00:00
|
|
|
|
|
|
|
log = logging.getLogger(__name__)
|
|
|
|
|
|
|
|
def task(ctx, config):
|
|
|
|
"""
|
|
|
|
Sync or skew clock
|
|
|
|
|
|
|
|
This will initially sync the clocks. Eventually it should let us also
|
|
|
|
skew by some number of seconds.
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
- clock:
|
|
|
|
- ceph:
|
|
|
|
- interactive:
|
|
|
|
|
|
|
|
to sync.
|
|
|
|
|
|
|
|
To skew, we should allow something like:
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
- clock:
|
|
|
|
mon.0: -2
|
|
|
|
client.1: 2
|
|
|
|
- ceph:
|
|
|
|
- interactive:
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
ctx.cluster.run(
|
|
|
|
args=[
|
2011-06-22 21:14:49 +00:00
|
|
|
'sudo',
|
|
|
|
'service', 'ntp', 'stop',
|
|
|
|
run.Raw(';'),
|
2011-06-16 21:37:52 +00:00
|
|
|
'sudo',
|
|
|
|
'ntpdate',
|
|
|
|
'clock1.dreamhost.com',
|
|
|
|
'clock2.dreamhost.com',
|
|
|
|
'clock3.dreamhost.com',
|
2011-06-22 21:14:49 +00:00
|
|
|
run.Raw(';'),
|
|
|
|
'sudo',
|
|
|
|
'service', 'ntp', 'start',
|
|
|
|
run.Raw('||'),
|
|
|
|
'true'
|
2011-06-16 21:37:52 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
# TODO do the skew
|
|
|
|
#for role, skew in config.iteritems():
|