def connect(args):
- cd_conf = getattr(args, 'cd_conf', None)
- if not cd_conf:
- raise RuntimeError(
- 'a ceph-deploy configuration is required but was not found'
- )
-
- repo_name = args.release or 'calamari-minion'
- has_minion_repo = cd_conf.has_section(repo_name)
-
- if not has_minion_repo:
- raise RuntimeError('no calamari-minion repo found')
-
for hostname in args.hosts:
distro = hosts.get(hostname, username=args.username)
if not distro_is_supported(distro.normalized_name):
distro.codename
)
- # We rely on the default for repo installs that does not install ceph
- # unless specified otherwise. We define the `options` dictionary here
- # because ceph-deploy pops items iternally and that causes issues when
- # those items need to be available for every host
- options = dict(cd_conf.items(repo_name))
-
rlogger = logging.getLogger(hostname)
- if distro.name in ('debian', 'ubuntu'):
- rlogger.info('ensuring proxy is disabled for calamari minions repo')
- distro.conn.remote_module.write_file(
- '/etc/apt/apt.conf.d/99ceph',
- 'Acquire::http::Proxy::%s DIRECT;' % args.master,
- )
- rlogger.info('installing calamari-minion package on %s' % hostname)
- rlogger.info('adding custom repository file')
- try:
- distro.repo_install(
- distro,
- repo_name,
- options.pop('baseurl'),
- options.pop('gpgkey', ''), # will probably not use a gpgkey
- **options
- )
- except KeyError as err:
- raise RuntimeError(
- 'missing required key: %s in config section: %s' % (
- err,
- repo_name
- )
- )
# Emplace minion config prior to installation so that it is present
# when the minion first starts.