Add Scaleway

This commit is contained in:
Jack Ivanov 2019-11-20 12:30:40 +01:00
parent 37275e2ae3
commit d1c21d62b7
3 changed files with 31 additions and 2 deletions

View file

@ -11,7 +11,6 @@ users:
### Advanced users only below this line ###
# Changing the port not supported by Scaleway, the default (22) is always used
ssh_port: 4160
# Store the PKI in a ram disk. Enabled only if store_pki (retain the PKI) is set to false

View file

@ -21,6 +21,33 @@
{%- endfor -%}]
- name: Create a server
scaleway_compute:
name: "{{ algo_server_name }}"
enable_ipv6: true
public_ip: dynamic
boot_type: local
state: present
image: "{{ images[0] }}"
organization: "{{ organization_id }}"
region: "{{ algo_region }}"
commercial_type: "{{ cloud_providers.scaleway.size }}"
wait: true
tags:
- Environment:Algo
- AUTHORIZED_KEY={{ lookup('file', SSH_keys.public)|regex_replace(' ', '_') }}
register: scaleway_compute
- name: Patch the cloud-init
uri:
url: "https://cp-{{ region }}.scaleway.com/servers/{{ scaleway_compute.msg.id }}/user_data/cloud-init"
method: PATCH
body: "{{ lookup('template', 'files/cloud-init/base.yml') }}"
status_code: 204
headers:
Content-Type: "text/plain"
X-Auth-Token: "{{ algo_scaleway_token }}"
- name: Start the server
scaleway_compute:
name: "{{ algo_server_name }}"
enable_ipv6: true
@ -44,4 +71,6 @@
- set_fact:
cloud_instance_ip: "{{ algo_instance.msg.public_ip.address }}"
ansible_ssh_user: root
ansible_ssh_user: algo
ansible_ssh_port: "{{ ssh_port }}"
cloudinit: true

View file

@ -12,6 +12,7 @@
delay: 10
timeout: 600
state: present
become: false
when: cloudinit
- block: