cli_installer.py 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  1. # TODO: Temporarily disabled due to importing old code into openshift-ansible
  2. # repo. We will work on these over time.
  3. # pylint: disable=bad-continuation,missing-docstring,no-self-use,invalid-name,no-value-for-parameter
  4. import click
  5. import os
  6. import re
  7. import sys
  8. from ooinstall import openshift_ansible
  9. from ooinstall import OOConfig
  10. from ooinstall.oo_config import Host
  11. from ooinstall.variants import find_variant, get_variant_version_combos
  12. DEFAULT_ANSIBLE_CONFIG = '/usr/share/atomic-openshift-utils/ansible.cfg'
  13. DEFAULT_PLAYBOOK_DIR = '/usr/share/ansible/openshift-ansible/'
  14. def validate_ansible_dir(path):
  15. if not path:
  16. raise click.BadParameter('An ansible path must be provided')
  17. return path
  18. # if not os.path.exists(path)):
  19. # raise click.BadParameter("Path \"{}\" doesn't exist".format(path))
  20. def is_valid_hostname(hostname):
  21. if not hostname or len(hostname) > 255:
  22. return False
  23. if hostname[-1] == ".":
  24. hostname = hostname[:-1] # strip exactly one dot from the right, if present
  25. allowed = re.compile(r"(?!-)[A-Z\d-]{1,63}(?<!-)$", re.IGNORECASE)
  26. return all(allowed.match(x) for x in hostname.split("."))
  27. def validate_prompt_hostname(hostname):
  28. if '' == hostname or is_valid_hostname(hostname):
  29. return hostname
  30. raise click.BadParameter('"{}" appears to be an invalid hostname. ' \
  31. 'Please double-check this value i' \
  32. 'and re-enter it.'.format(hostname))
  33. def get_ansible_ssh_user():
  34. click.clear()
  35. message = """
  36. This installation process will involve connecting to remote hosts via ssh. Any
  37. account may be used however if a non-root account is used it must have
  38. passwordless sudo access.
  39. """
  40. click.echo(message)
  41. return click.prompt('User for ssh access', default='root')
  42. def list_hosts(hosts):
  43. hosts_idx = range(len(hosts))
  44. for idx in hosts_idx:
  45. click.echo(' {}: {}'.format(idx, hosts[idx]))
  46. def delete_hosts(hosts):
  47. while True:
  48. list_hosts(hosts)
  49. del_idx = click.prompt('Select host to delete, y/Y to confirm, ' \
  50. 'or n/N to add more hosts', default='n')
  51. try:
  52. del_idx = int(del_idx)
  53. hosts.remove(hosts[del_idx])
  54. except IndexError:
  55. click.echo("\"{}\" doesn't match any hosts listed.".format(del_idx))
  56. except ValueError:
  57. try:
  58. response = del_idx.lower()
  59. if response in ['y', 'n']:
  60. return hosts, response
  61. click.echo("\"{}\" doesn't coorespond to any valid input.".format(del_idx))
  62. except AttributeError:
  63. click.echo("\"{}\" doesn't coorespond to any valid input.".format(del_idx))
  64. return hosts, None
  65. def collect_hosts():
  66. """
  67. Collect host information from user. This will later be filled in using
  68. ansible.
  69. Returns: a list of host information collected from the user
  70. """
  71. click.clear()
  72. click.echo('***Host Configuration***')
  73. message = """
  74. The OpenShift Master serves the API and web console. It also coordinates the
  75. jobs that have to run across the environment. It can even run the datastore.
  76. For wizard based installations the database will be embedded. It's possible to
  77. change this later using etcd from Red Hat Enterprise Linux 7.
  78. Any Masters configured as part of this installation process will also be
  79. configured as Nodes. This is so that the Master will be able to proxy to Pods
  80. from the API. By default this Node will be unscheduleable but this can be changed
  81. after installation with 'oadm manage-node'.
  82. The OpenShift Node provides the runtime environments for containers. It will
  83. host the required services to be managed by the Master.
  84. http://docs.openshift.com/enterprise/latest/architecture/infrastructure_components/kubernetes_infrastructure.html#master
  85. http://docs.openshift.com/enterprise/latest/architecture/infrastructure_components/kubernetes_infrastructure.html#node
  86. """
  87. click.echo(message)
  88. hosts = []
  89. more_hosts = True
  90. while more_hosts:
  91. host_props = {}
  92. hostname_or_ip = click.prompt('Enter hostname or IP address:',
  93. default='',
  94. value_proc=validate_prompt_hostname)
  95. host_props['connect_to'] = hostname_or_ip
  96. host_props['master'] = click.confirm('Will this host be an OpenShift Master?')
  97. host_props['node'] = True
  98. #TODO: Reenable this option once container installs are out of tech preview
  99. #rpm_or_container = click.prompt('Will this host be RPM or Container based (rpm/container)?',
  100. # type=click.Choice(['rpm', 'container']),
  101. # default='rpm')
  102. #if rpm_or_container == 'container':
  103. # host_props['containerized'] = True
  104. #else:
  105. # host_props['containerized'] = False
  106. host_props['containerized'] = False
  107. host = Host(**host_props)
  108. hosts.append(host)
  109. more_hosts = click.confirm('Do you want to add additional hosts?')
  110. return hosts
  111. def confirm_hosts_facts(oo_cfg, callback_facts):
  112. hosts = oo_cfg.hosts
  113. click.clear()
  114. message = """
  115. A list of the facts gathered from the provided hosts follows. Because it is
  116. often the case that the hostname for a system inside the cluster is different
  117. from the hostname that is resolveable from command line or web clients
  118. these settings cannot be validated automatically.
  119. For some cloud providers the installer is able to gather metadata exposed in
  120. the instance so reasonable defaults will be provided.
  121. Plese confirm that they are correct before moving forward.
  122. """
  123. notes = """
  124. Format:
  125. connect_to,IP,public IP,hostname,public hostname
  126. Notes:
  127. * The installation host is the hostname from the installer's perspective.
  128. * The IP of the host should be the internal IP of the instance.
  129. * The public IP should be the externally accessible IP associated with the instance
  130. * The hostname should resolve to the internal IP from the instances
  131. themselves.
  132. * The public hostname should resolve to the external ip from hosts outside of
  133. the cloud.
  134. """
  135. # For testing purposes we need to click.echo only once, so build up
  136. # the message:
  137. output = message
  138. default_facts_lines = []
  139. default_facts = {}
  140. for h in hosts:
  141. default_facts[h.connect_to] = {}
  142. h.ip = callback_facts[h.connect_to]["common"]["ip"]
  143. h.public_ip = callback_facts[h.connect_to]["common"]["public_ip"]
  144. h.hostname = callback_facts[h.connect_to]["common"]["hostname"]
  145. h.public_hostname = callback_facts[h.connect_to]["common"]["public_hostname"]
  146. default_facts_lines.append(",".join([h.connect_to,
  147. h.ip,
  148. h.public_ip,
  149. h.hostname,
  150. h.public_hostname]))
  151. output = "%s\n%s" % (output, ",".join([h.connect_to,
  152. h.ip,
  153. h.public_ip,
  154. h.hostname,
  155. h.public_hostname]))
  156. output = "%s\n%s" % (output, notes)
  157. click.echo(output)
  158. facts_confirmed = click.confirm("Do the above facts look correct?")
  159. if not facts_confirmed:
  160. message = """
  161. Edit %s with the desired values and run `atomic-openshift-installer --unattended install` to restart the install.
  162. """ % oo_cfg.config_path
  163. click.echo(message)
  164. # Make sure we actually write out the config file.
  165. oo_cfg.save_to_disk()
  166. sys.exit(0)
  167. return default_facts
  168. def get_variant_and_version():
  169. message = "\nWhich variant would you like to install?\n\n"
  170. i = 1
  171. combos = get_variant_version_combos()
  172. for (variant, version) in combos:
  173. message = "%s\n(%s) %s %s" % (message, i, variant.description,
  174. version.name)
  175. i = i + 1
  176. click.echo(message)
  177. response = click.prompt("Choose a variant from above: ", default=1)
  178. product, version = combos[response - 1]
  179. return product, version
  180. def confirm_continue(message):
  181. click.echo(message)
  182. click.confirm("Are you ready to continue?", default=False, abort=True)
  183. return
  184. def error_if_missing_info(oo_cfg):
  185. missing_info = False
  186. if not oo_cfg.hosts:
  187. missing_info = True
  188. click.echo('For unattended installs, hosts must be specified on the '
  189. 'command line or in the config file: %s' % oo_cfg.config_path)
  190. sys.exit(1)
  191. if 'ansible_ssh_user' not in oo_cfg.settings:
  192. click.echo("Must specify ansible_ssh_user in configuration file.")
  193. sys.exit(1)
  194. # Lookup a variant based on the key we were given:
  195. if not oo_cfg.settings['variant']:
  196. click.echo("No variant specified in configuration file.")
  197. sys.exit(1)
  198. ver = None
  199. if 'variant_version' in oo_cfg.settings:
  200. ver = oo_cfg.settings['variant_version']
  201. variant, version = find_variant(oo_cfg.settings['variant'], version=ver)
  202. if variant is None or version is None:
  203. err_variant_name = oo_cfg.settings['variant']
  204. if ver:
  205. err_variant_name = "%s %s" % (err_variant_name, ver)
  206. click.echo("%s is not an installable variant." % err_variant_name)
  207. sys.exit(1)
  208. oo_cfg.settings['variant_version'] = version.name
  209. missing_facts = oo_cfg.calc_missing_facts()
  210. if len(missing_facts) > 0:
  211. missing_info = True
  212. click.echo('For unattended installs, facts must be provided for all masters/nodes:')
  213. for host in missing_facts:
  214. click.echo('Host "%s" missing facts: %s' % (host, ", ".join(missing_facts[host])))
  215. if missing_info:
  216. sys.exit(1)
  217. def get_missing_info_from_user(oo_cfg):
  218. """ Prompts the user for any information missing from the given configuration. """
  219. click.clear()
  220. message = """
  221. Welcome to the OpenShift Enterprise 3 installation.
  222. Please confirm that following prerequisites have been met:
  223. * All systems where OpenShift will be installed are running Red Hat Enterprise
  224. Linux 7.
  225. * All systems are properly subscribed to the required OpenShift Enterprise 3
  226. repositories.
  227. * All systems have run docker-storage-setup (part of the Red Hat docker RPM).
  228. * All systems have working DNS that resolves not only from the perspective of
  229. the installer but also from within the cluster.
  230. When the process completes you will have a default configuration for Masters
  231. and Nodes. For ongoing environment maintenance it's recommended that the
  232. official Ansible playbooks be used.
  233. For more information on installation prerequisites please see:
  234. https://docs.openshift.com/enterprise/latest/admin_guide/install/prerequisites.html
  235. """
  236. confirm_continue(message)
  237. click.clear()
  238. if oo_cfg.settings.get('ansible_ssh_user', '') == '':
  239. oo_cfg.settings['ansible_ssh_user'] = get_ansible_ssh_user()
  240. click.clear()
  241. if not oo_cfg.hosts:
  242. oo_cfg.hosts = collect_hosts()
  243. click.clear()
  244. if oo_cfg.settings.get('variant', '') == '':
  245. variant, version = get_variant_and_version()
  246. oo_cfg.settings['variant'] = variant.name
  247. oo_cfg.settings['variant_version'] = version.name
  248. click.clear()
  249. return oo_cfg
  250. def collect_new_nodes():
  251. click.clear()
  252. click.echo('***New Node Configuration***')
  253. message = """
  254. Add new nodes here
  255. """
  256. click.echo(message)
  257. return collect_hosts()
  258. def get_installed_hosts(hosts, callback_facts):
  259. installed_hosts = []
  260. for host in hosts:
  261. if(host.connect_to in callback_facts.keys()
  262. and 'common' in callback_facts[host.connect_to].keys()
  263. and callback_facts[host.connect_to]['common'].get('version', '')
  264. and callback_facts[host.connect_to]['common'].get('version', '') != 'None'):
  265. installed_hosts.append(host)
  266. return installed_hosts
  267. # pylint: disable=too-many-branches
  268. # This pylint error will be corrected shortly in separate PR.
  269. def get_hosts_to_run_on(oo_cfg, callback_facts, unattended, force, verbose):
  270. # Copy the list of existing hosts so we can remove any already installed nodes.
  271. hosts_to_run_on = list(oo_cfg.hosts)
  272. # Check if master or nodes already have something installed
  273. installed_hosts = get_installed_hosts(oo_cfg.hosts, callback_facts)
  274. if len(installed_hosts) > 0:
  275. click.echo('Installed environment detected.')
  276. # This check has to happen before we start removing hosts later in this method
  277. if not force:
  278. if not unattended:
  279. click.echo('By default the installer only adds new nodes to an installed environment.')
  280. response = click.prompt('Do you want to (1) only add additional nodes or ' \
  281. '(2) reinstall the existing hosts ' \
  282. 'potentially erasing any custom changes?',
  283. type=int)
  284. # TODO: this should be reworked with error handling.
  285. # Click can certainly do this for us.
  286. # This should be refactored as soon as we add a 3rd option.
  287. if response == 1:
  288. force = False
  289. if response == 2:
  290. force = True
  291. # present a message listing already installed hosts and remove hosts if needed
  292. for host in installed_hosts:
  293. if host.master:
  294. click.echo("{} is already an OpenShift Master".format(host))
  295. # Masters stay in the list, we need to run against them when adding
  296. # new nodes.
  297. elif host.node:
  298. click.echo("{} is already an OpenShift Node".format(host))
  299. # force is only used for reinstalls so we don't want to remove
  300. # anything.
  301. if not force:
  302. hosts_to_run_on.remove(host)
  303. # Handle the cases where we know about uninstalled systems
  304. new_hosts = set(hosts_to_run_on) - set(installed_hosts)
  305. if len(new_hosts) > 0:
  306. for new_host in new_hosts:
  307. click.echo("{} is currently uninstalled".format(new_host))
  308. # Fall through
  309. click.echo('Adding additional nodes...')
  310. else:
  311. if unattended:
  312. if not force:
  313. click.echo('Installed environment detected and no additional nodes specified: ' \
  314. 'aborting. If you want a fresh install, use ' \
  315. '`atomic-openshift-installer install --force`')
  316. sys.exit(1)
  317. else:
  318. if not force:
  319. new_nodes = collect_new_nodes()
  320. hosts_to_run_on.extend(new_nodes)
  321. oo_cfg.hosts.extend(new_nodes)
  322. openshift_ansible.set_config(oo_cfg)
  323. click.echo('Gathering information from hosts...')
  324. callback_facts, error = openshift_ansible.default_facts(oo_cfg.hosts, verbose)
  325. if error:
  326. click.echo("There was a problem fetching the required information. " \
  327. "See {} for details.".format(oo_cfg.settings['ansible_log_path']))
  328. sys.exit(1)
  329. else:
  330. pass # proceeding as normal should do a clean install
  331. return hosts_to_run_on, callback_facts
  332. @click.group()
  333. @click.pass_context
  334. @click.option('--unattended', '-u', is_flag=True, default=False)
  335. @click.option('--configuration', '-c',
  336. type=click.Path(file_okay=True,
  337. dir_okay=False,
  338. writable=True,
  339. readable=True),
  340. default=None)
  341. @click.option('--ansible-playbook-directory',
  342. '-a',
  343. type=click.Path(exists=True,
  344. file_okay=False,
  345. dir_okay=True,
  346. readable=True),
  347. # callback=validate_ansible_dir,
  348. default=DEFAULT_PLAYBOOK_DIR,
  349. envvar='OO_ANSIBLE_PLAYBOOK_DIRECTORY')
  350. @click.option('--ansible-config',
  351. type=click.Path(file_okay=True,
  352. dir_okay=False,
  353. writable=True,
  354. readable=True),
  355. default=None)
  356. @click.option('--ansible-log-path',
  357. type=click.Path(file_okay=True,
  358. dir_okay=False,
  359. writable=True,
  360. readable=True),
  361. default="/tmp/ansible.log")
  362. @click.option('-v', '--verbose',
  363. is_flag=True, default=False)
  364. #pylint: disable=too-many-arguments
  365. # Main CLI entrypoint, not much we can do about too many arguments.
  366. def cli(ctx, unattended, configuration, ansible_playbook_directory, ansible_config, ansible_log_path, verbose):
  367. """
  368. atomic-openshift-installer makes the process for installing OSE or AEP easier by interactively gathering the data needed to run on each host.
  369. It can also be run in unattended mode if provided with a configuration file.
  370. Further reading: https://docs.openshift.com/enterprise/latest/install_config/install/quick_install.html
  371. """
  372. ctx.obj = {}
  373. ctx.obj['unattended'] = unattended
  374. ctx.obj['configuration'] = configuration
  375. ctx.obj['ansible_config'] = ansible_config
  376. ctx.obj['ansible_log_path'] = ansible_log_path
  377. ctx.obj['verbose'] = verbose
  378. oo_cfg = OOConfig(ctx.obj['configuration'])
  379. # If no playbook dir on the CLI, check the config:
  380. if not ansible_playbook_directory:
  381. ansible_playbook_directory = oo_cfg.settings.get('ansible_playbook_directory', '')
  382. # If still no playbook dir, check for the default location:
  383. if not ansible_playbook_directory and os.path.exists(DEFAULT_PLAYBOOK_DIR):
  384. ansible_playbook_directory = DEFAULT_PLAYBOOK_DIR
  385. validate_ansible_dir(ansible_playbook_directory)
  386. oo_cfg.settings['ansible_playbook_directory'] = ansible_playbook_directory
  387. oo_cfg.ansible_playbook_directory = ansible_playbook_directory
  388. ctx.obj['ansible_playbook_directory'] = ansible_playbook_directory
  389. if ctx.obj['ansible_config']:
  390. oo_cfg.settings['ansible_config'] = ctx.obj['ansible_config']
  391. elif os.path.exists(DEFAULT_ANSIBLE_CONFIG):
  392. # If we're installed by RPM this file should exist and we can use it as our default:
  393. oo_cfg.settings['ansible_config'] = DEFAULT_ANSIBLE_CONFIG
  394. oo_cfg.settings['ansible_log_path'] = ctx.obj['ansible_log_path']
  395. ctx.obj['oo_cfg'] = oo_cfg
  396. openshift_ansible.set_config(oo_cfg)
  397. @click.command()
  398. @click.pass_context
  399. def uninstall(ctx):
  400. oo_cfg = ctx.obj['oo_cfg']
  401. verbose = ctx.obj['verbose']
  402. if len(oo_cfg.hosts) == 0:
  403. click.echo("No hosts defined in: %s" % oo_cfg['configuration'])
  404. sys.exit(1)
  405. click.echo("OpenShift will be uninstalled from the following hosts:\n")
  406. if not ctx.obj['unattended']:
  407. # Prompt interactively to confirm:
  408. for host in oo_cfg.hosts:
  409. click.echo(" * %s" % host.connect_to)
  410. proceed = click.confirm("\nDo you wish to proceed?")
  411. if not proceed:
  412. click.echo("Uninstall cancelled.")
  413. sys.exit(0)
  414. openshift_ansible.run_uninstall_playbook(verbose)
  415. @click.command()
  416. @click.pass_context
  417. def upgrade(ctx):
  418. oo_cfg = ctx.obj['oo_cfg']
  419. verbose = ctx.obj['verbose']
  420. if len(oo_cfg.hosts) == 0:
  421. click.echo("No hosts defined in: %s" % oo_cfg.config_path)
  422. sys.exit(1)
  423. # Update config to reflect the version we're targetting, we'll write
  424. # to disk once ansible completes successfully, not before.
  425. old_variant = oo_cfg.settings['variant']
  426. old_version = oo_cfg.settings['variant_version']
  427. if oo_cfg.settings['variant'] == 'enterprise':
  428. oo_cfg.settings['variant'] = 'openshift-enterprise'
  429. version = find_variant(oo_cfg.settings['variant'])[1]
  430. oo_cfg.settings['variant_version'] = version.name
  431. click.echo("Openshift will be upgraded from %s %s to %s %s on the following hosts:\n" % (
  432. old_variant, old_version, oo_cfg.settings['variant'],
  433. oo_cfg.settings['variant_version']))
  434. for host in oo_cfg.hosts:
  435. click.echo(" * %s" % host.connect_to)
  436. if not ctx.obj['unattended']:
  437. # Prompt interactively to confirm:
  438. proceed = click.confirm("\nDo you wish to proceed?")
  439. if not proceed:
  440. click.echo("Upgrade cancelled.")
  441. sys.exit(0)
  442. retcode = openshift_ansible.run_upgrade_playbook(verbose)
  443. if retcode > 0:
  444. click.echo("Errors encountered during upgrade, please check %s." %
  445. oo_cfg.settings['ansible_log_path'])
  446. else:
  447. oo_cfg.save_to_disk()
  448. click.echo("Upgrade completed! Rebooting all hosts is recommended.")
  449. @click.command()
  450. @click.option('--force', '-f', is_flag=True, default=False)
  451. @click.pass_context
  452. def install(ctx, force):
  453. oo_cfg = ctx.obj['oo_cfg']
  454. verbose = ctx.obj['verbose']
  455. if ctx.obj['unattended']:
  456. error_if_missing_info(oo_cfg)
  457. else:
  458. oo_cfg = get_missing_info_from_user(oo_cfg)
  459. click.echo('Gathering information from hosts...')
  460. callback_facts, error = openshift_ansible.default_facts(oo_cfg.hosts,
  461. verbose)
  462. if error:
  463. click.echo("There was a problem fetching the required information. " \
  464. "Please see {} for details.".format(oo_cfg.settings['ansible_log_path']))
  465. sys.exit(1)
  466. hosts_to_run_on, callback_facts = get_hosts_to_run_on(
  467. oo_cfg, callback_facts, ctx.obj['unattended'], force, verbose)
  468. click.echo('Writing config to: %s' % oo_cfg.config_path)
  469. # We already verified this is not the case for unattended installs, so this can
  470. # only trigger for live CLI users:
  471. # TODO: if there are *new* nodes and this is a live install, we may need the user
  472. # to confirm the settings for new nodes. Look into this once we're distinguishing
  473. # between new and pre-existing nodes.
  474. if len(oo_cfg.calc_missing_facts()) > 0:
  475. confirm_hosts_facts(oo_cfg, callback_facts)
  476. oo_cfg.save_to_disk()
  477. click.echo('Ready to run installation process.')
  478. message = """
  479. If changes are needed to the values recorded by the installer please update {}.
  480. """.format(oo_cfg.config_path)
  481. if not ctx.obj['unattended']:
  482. confirm_continue(message)
  483. error = openshift_ansible.run_main_playbook(oo_cfg.hosts,
  484. hosts_to_run_on, verbose)
  485. if error:
  486. # The bootstrap script will print out the log location.
  487. message = """
  488. An error was detected. After resolving the problem please relaunch the
  489. installation process.
  490. """
  491. click.echo(message)
  492. sys.exit(1)
  493. else:
  494. message = """
  495. The installation was successful!
  496. If this is your first time installing please take a look at the Administrator
  497. Guide for advanced options related to routing, storage, authentication and much
  498. more:
  499. http://docs.openshift.com/enterprise/latest/admin_guide/overview.html
  500. """
  501. click.echo(message)
  502. click.pause()
  503. cli.add_command(install)
  504. cli.add_command(upgrade)
  505. cli.add_command(uninstall)
  506. if __name__ == '__main__':
  507. # This is expected behaviour for context passing with click library:
  508. # pylint: disable=unexpected-keyword-arg
  509. cli(obj={})