[go: nahoru, domu]

Skip to content

Commit

Permalink
Merge pull request #89 from sclo/INFRA-9859_update_boot_options
Browse files Browse the repository at this point in the history
INFRA-9859: update dedicated server boot option
  • Loading branch information
tortuegenialez committed Jul 16, 2024
2 parents f8848d9 + 836759f commit 1e43069
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions plugins/modules/dedicated_server_boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
boot:
required: true
default: harddisk
choices: ['harddisk','rescue','rescue-customer']
choices: ['harddisk','rescue-customer','ipxe-shell','poweroff']
description:
- Which way you want to boot your dedicated server
force_reboot:
Expand Down Expand Up @@ -53,7 +53,7 @@ def run_module():
module_args = ovh_argument_spec()
module_args.update(dict(
service_name=dict(required=True),
boot=dict(required=True, choices=['harddisk', 'rescue', 'rescue-customer']),
boot=dict(required=True, choices=['harddisk', 'rescue-customer', 'ipxe-shell', 'poweroff']),
force_reboot=dict(required=False, default=False, type='bool')
))

Expand All @@ -68,7 +68,7 @@ def run_module():
force_reboot = module.params['force_reboot']
changed = False

bootid = {'harddisk': 1, 'rescue': 1122, 'rescue-customer': 46371}
bootid = {'harddisk': 1, 'rescue-customer': 46371, 'ipxe-shell': 203323, 'poweroff': 95083}
if module.check_mode:
module.exit_json(
msg="{} is now set to boot on {}. Reboot in progress... - (dry run mode)".format(service_name, boot),
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/dedicated_server_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ def run_module():
user_metadata = module.params['user_metadata']

if module.check_mode:
module.exit_json(msg="Installation in progress on {} as {} with template {} - (dry run mode)".format(service_name, hostname, template),
module.exit_json(msg=f"Installation in progress on {service_name} as {hostname} with template {template} - (dry run mode)",
changed=True)

compatible_templates = client.wrap_call(
"GET",
f"/dedicated/server/{service_name}/install/compatibleTemplates"
)
if template not in compatible_templates["ovh"] and template not in compatible_templates["personal"]:
module.fail_json(msg="{} doesn't exist in compatibles templates".format(template))
module.fail_json(msg="f{template} doesn't exist in compatibles templates")

details = {"details":
{"language": "en",
Expand All @@ -110,7 +110,7 @@ def run_module():
userMetadata=user_metadata,
)

module.exit_json(msg="Installation in progress on {} as {} with template {}!".format(service_name, hostname, template), changed=True)
module.exit_json(msg=f"Installation in progress on {service_name} as {hostname} with template {template}!", changed=True)


def main():
Expand Down

0 comments on commit 1e43069

Please sign in to comment.