From 3f777e2e65abc843cdfa5fb6ce105c9c810b3546 Mon Sep 17 00:00:00 2001 From: Fredrik Lindgren Date: Fri, 8 Jun 2018 14:59:21 +0200 Subject: [PATCH] Add option for host comment in bootstrap.py Add option --comment for bootstrap.py --- bootstrap.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bootstrap.py b/bootstrap.py index dff3c69..75e71b7 100755 --- a/bootstrap.py +++ b/bootstrap.py @@ -760,6 +760,8 @@ def create_host(): jsondata['host']['domain_id'] = mydomainid if options.ip: jsondata['host']['ip'] = options.ip + if options.comment: + jsondata['host']['comment'] = options.comment myurl = "https://" + options.foreman_fqdn + ":" + API_PORT + "/api/v2/hosts/" if options.force and host_id is not None: disassociate_host(host_id) @@ -1011,6 +1013,7 @@ def exec_service(service, command, failonerror=True): parser.add_option("--install-packages", dest="install_packages", help="List of packages to be additionally installed - comma separated", metavar="installpackages") parser.add_option("--new-capsule", dest="new_capsule", action="store_true", help="Switch the server to a new capsule for content and Puppet. Pass --server with the Capsule FQDN as well.") parser.add_option("-t", "--timeout", dest="timeout", type="int", help="Timeout (in seconds) for API calls and subscription-manager registration. Defaults to %default", metavar="timeout", default=900) + parser.add_option("-c", "--comment", dest="comment", help="Add a host comment") (options, args) = parser.parse_args() if options.no_foreman: