-
Notifications
You must be signed in to change notification settings - Fork 305
/
install.py
63 lines (56 loc) · 1.68 KB
/
install.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
from ceph_deploy.lib.remoto import process
def install(distro, version_kind, version, adjust_repos):
release = distro.release
machine = distro.machine_type
if version_kind in ['stable', 'testing']:
key = 'release'
else:
key = 'autobuild'
if adjust_repos:
process.run(
distro.conn,
[
"su",
"-c",
"'rpm --import \"https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/{key}.asc\"'".format(key=key),
],
)
if version_kind == 'stable':
url = 'http://ceph.com/rpm-{version}/fc{release}/'.format(
version=version,
release=release,
)
elif version_kind == 'testing':
url = 'http://ceph.com/rpm-testing/fc{release}'.format(
release=release,
)
elif version_kind == 'dev':
url = 'http://gitbuilder.ceph.com/ceph-rpm-fc{release}-{machine}-basic/ref/{version}/'.format(
release=release.split(".", 1)[0],
machine=machine,
version=version,
)
process.run(
distro.conn,
[
'rpm',
'-Uvh',
'--replacepkgs',
'--force',
'--quiet',
'{url}noarch/ceph-release-1-0.fc{release}.noarch.rpm'.format(
url=url,
release=release,
),
]
)
process.run(
distro.conn,
[
'yum',
'-y',
'-q',
'install',
'ceph',
],
)