-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RM-7505 Add support for Arch Linux #461
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from . import mon # noqa | ||
from ceph_deploy.hosts.centos.install import repo_install # noqa | ||
from .install import install, mirror_install # noqa | ||
from .uninstall import uninstall # noqa | ||
from ceph_deploy.util import pkg_managers | ||
|
||
# Allow to set some information about this distro | ||
# | ||
|
||
distro = None | ||
release = None | ||
codename = None | ||
|
||
|
||
def choose_init(module): | ||
""" | ||
Select a init system | ||
|
||
Returns the name of a init system (upstart, sysvinit ...). | ||
""" | ||
|
||
return 'systemd' | ||
|
||
|
||
def get_packager(module): | ||
return pkg_managers.Pacman(module) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
from ceph_deploy.hosts.centos.install import repo_install, mirror_install # noqa | ||
from ceph_deploy.hosts.common import map_components | ||
from ceph_deploy.util.system import enable_service, start_service | ||
|
||
|
||
NON_SPLIT_PACKAGES = [ | ||
'ceph-osd', | ||
'ceph-radosgw', | ||
'ceph-mds', | ||
'ceph-mon', | ||
'ceph-mgr', | ||
'ceph-common', | ||
'ceph-test' | ||
] | ||
|
||
SYSTEMD_UNITS = [ | ||
'ceph.target', | ||
'ceph-radosgw.target', | ||
'ceph-rbd-mirror.target', | ||
'ceph-fuse.target', | ||
'ceph-mds.target', | ||
'ceph-mon.target', | ||
'ceph-mgr.target', | ||
'ceph-osd.target', | ||
] | ||
SYSTEMD_UNITS_SKIP_START = [ | ||
'ceph-mgr.target', | ||
'ceph-mon.target', | ||
] | ||
SYSTEMD_UNITS_SKIP_ENABLE = [ | ||
] | ||
|
||
|
||
def install(distro, version_kind, version, adjust_repos, **kw): | ||
packages = map_components( | ||
NON_SPLIT_PACKAGES, | ||
kw.pop('components', []) | ||
) | ||
|
||
distro.packager.install( | ||
packages | ||
) | ||
|
||
# Start and enable services | ||
for unit in SYSTEMD_UNITS: | ||
if unit not in SYSTEMD_UNITS_SKIP_START: | ||
start_service(distro.conn, unit) | ||
if unit not in SYSTEMD_UNITS_SKIP_ENABLE: | ||
enable_service(distro.conn, unit) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from ceph_deploy.hosts.common import mon_add as add # noqa | ||
from ceph_deploy.hosts.common import mon_create as create # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import logging | ||
|
||
from ceph_deploy.util.system import disable_service, stop_service | ||
from ceph_deploy.lib import remoto | ||
|
||
|
||
SYSTEMD_UNITS = [ | ||
'ceph-mds.target', | ||
'ceph-mon.target', | ||
'ceph-osd.target', | ||
'ceph-radosgw.target', | ||
'ceph-fuse.target', | ||
'ceph-mgr.target', | ||
'ceph-rbd-mirror.target', | ||
'ceph.target', | ||
] | ||
|
||
|
||
def uninstall(distro, purge=False): | ||
packages = [ | ||
'ceph', | ||
] | ||
|
||
hostname = distro.conn.hostname | ||
LOG = logging.getLogger(hostname) | ||
|
||
# I need to stop and disable services prior package removal | ||
LOG.info('stopping and disabling services on {}'.format(hostname)) | ||
for unit in SYSTEMD_UNITS: | ||
stop_service(distro.conn, unit) | ||
disable_service(distro.conn, unit) | ||
|
||
# remoto.process.run( | ||
# distro.conn, | ||
# [ | ||
# 'systemctl', | ||
# 'daemon-reload', | ||
# ] | ||
# ) | ||
|
||
LOG.info('uninstalling packages on {}'.format(hostname)) | ||
distro.packager.remove(packages) | ||
|
||
remoto.process.run( | ||
distro.conn, | ||
[ | ||
'systemctl', | ||
'reset-failed', | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this reads like a packaging problem on Arch's side. It is the package itself that should have rules that take care of this. I guess this doesn't happen here because you have encountered this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly, Arch packages don't start nor stop services, neither handle enabling/disabling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you prefer to notify the user, instead of starting and enabling services?