Skip to content

Instantly share code, notes, and snippets.

@Nesousx
Last active January 25, 2019 10:22
Show Gist options
  • Save Nesousx/f6ce54fbe062a6bbd2603f2098c4ddda to your computer and use it in GitHub Desktop.
Save Nesousx/f6ce54fbe062a6bbd2603f2098c4ddda to your computer and use it in GitHub Desktop.
curl and ansible way to reboot a scaleway bare metal server
### CURL command to reboot a bare metal Scaleway Server
curl -H 'X-Auth-Token: {{ scw_token }}' -H 'Content-Type: application/json' https://cp-{{ scw_region }}.scaleway.com/servers/{{ scw_server }}/action --request POST --data '{"action":"reboot"}'
### Ansible version
- name: Reboot server via scaleway API
uri:
url: "https://cp-{{ scw_region }}.scaleway.com/servers/{{ scw_server }}/action"
validate_certs: yes
method: POST
body:
action: reboot
body_format: json
status_code: 200, 202
headers:
Content-Type: "application/json"
X-Auth-Token: "{{ scw_token }}"
@jbarotin
Copy link

Thanks for sharing, I keep it as a backup, I'll try to do the same with the Scaleway ansible module:
https://docs.ansible.com/ansible/devel/modules/scaleway_compute_module.html#scaleway-compute-module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment