diff --git a/docs/cloud-cloudstack.md b/docs/cloud-cloudstack.md new file mode 100644 index 00000000..4aed3f41 --- /dev/null +++ b/docs/cloud-cloudstack.md @@ -0,0 +1,20 @@ +### Configuration file + +You need to create a configuration file in INI format with your api key in `$HOME/.cloudstack.ini` + +``` +[cloudstack] +endpoint = +key = +secret = +timeout = 30 +``` +Example for Exoscale (European cloud provider exposing CloudStack API), visit https://portal.exoscale.com/u//account/profile/api to gather the required information: + +``` +[cloudstack] +endpoint = https://api.exoscale.com/compute +key = +secret = +timeout = 30 +``` diff --git a/roles/cloud-cloudstack/tasks/main.yml b/roles/cloud-cloudstack/tasks/main.yml index 9f80aa9a..43266d4d 100644 --- a/roles/cloud-cloudstack/tasks/main.yml +++ b/roles/cloud-cloudstack/tasks/main.yml @@ -32,7 +32,7 @@ local_action: module: cs_sshkeypair name: "{{ SSH_keys.comment|regex_replace('@', '_') }}" - public_key: "{{ SSH_keys.public }}" + public_key: "{{ lookup('file', '{{ SSH_keys.public }}') }}" register: cs_keypair - name: Set facts @@ -47,10 +47,10 @@ module: cs_instance name: "{{ algo_server_name }}" root_disk_size: "{{ disk }}" - image: "{{ image_id }}" + template: "{{ image_id }}" ssh_key: "{{ keypair_name }}" security_groups: "{{ cs_security_group.name }}" - zone: "{{ _algo_region }}" + zone: "{{ _algo_region.user_input }}" register: cs_server - set_fact: