mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-03 10:38:19 -03:30
Add digitalocean test case
This commit is contained in:
committed by
Antoine Legrand
parent
442d211ee3
commit
3ef7c25a16
@@ -3,7 +3,50 @@
|
||||
become: false
|
||||
gather_facts: no
|
||||
vars:
|
||||
cloud_machine_type: g1-small
|
||||
state: "present"
|
||||
ssh_key_id: "6536865"
|
||||
cloud_machine_type: 2gb
|
||||
regions:
|
||||
- nyc1
|
||||
- sfo1
|
||||
- nyc2
|
||||
- ams2
|
||||
- sgp1
|
||||
- lon1
|
||||
- nyc3
|
||||
- ams3
|
||||
- fra1
|
||||
- tor1
|
||||
- sfo2
|
||||
- blr1
|
||||
cloud_images:
|
||||
- coreos-beta
|
||||
- fedora-24-x64
|
||||
- centos-5-x64
|
||||
- centos-5-x32
|
||||
- fedora-25-x64
|
||||
- debian-7-x64
|
||||
- debian-7-x32
|
||||
- debian-8-x64
|
||||
- debian-8-x32
|
||||
- centos-6-x32
|
||||
- centos-6-x64
|
||||
- coreos-stable
|
||||
- ubuntu-16-10-x32
|
||||
- ubuntu-16-10-x64
|
||||
- freebsd-11-0-x64-zfs
|
||||
- freebsd-10-3-x64-zfs
|
||||
- coreos-alpha
|
||||
- ubuntu-12-04-x32
|
||||
- ubuntu-12-04-x64
|
||||
- ubuntu-16-04-x64
|
||||
- ubuntu-16-04-x32
|
||||
- ubuntu-14-04-x64
|
||||
- ubuntu-14-04-x32
|
||||
- centos-7-x64
|
||||
- freebsd-11-0-x64
|
||||
- freebsd-10-3-x64
|
||||
- centos-7-3-1611-x64
|
||||
mode: default
|
||||
|
||||
tasks:
|
||||
@@ -19,7 +62,7 @@
|
||||
["k8s-{{test_name}}-1", "k8s-{{test_name}}-2"]
|
||||
{%- endif -%}
|
||||
|
||||
- name: Create DO instances
|
||||
- name: Manage DO instances | {{state}}
|
||||
digital_ocean:
|
||||
unique_name: yes
|
||||
api_token: "{{ lookup('env','DO_API_TOKEN') }}"
|
||||
@@ -28,21 +71,24 @@
|
||||
name: "{{ item }}"
|
||||
private_networking: no
|
||||
region_id: "{{cloud_region}}"
|
||||
size_id: 2gb
|
||||
ssh_key_ids: "6536865"
|
||||
state: present
|
||||
size_id: "{{cloud_machine_type}}"
|
||||
ssh_key_ids: "{{ssh_key_id}}"
|
||||
state: "{{state}}"
|
||||
wait: yes
|
||||
register: droplets
|
||||
with_items: "{{instance_names}}"
|
||||
|
||||
- debug:
|
||||
msg: "{{droplets}}, {{inventory_path}}"
|
||||
when: "{{ state == 'present' }}"
|
||||
|
||||
- name: Template the inventory
|
||||
template:
|
||||
src: ../templates/inventory-do.j2
|
||||
dest: "{{ inventory_path }}/inventory-do.cfg"
|
||||
dest: "{{ inventory_path }}"
|
||||
when: "{{ state == 'present' }}"
|
||||
|
||||
- name: Wait for SSH to come up
|
||||
wait_for: host={{item.droplet.ip_address}} port=22 delay=10 timeout=180 state=started
|
||||
with_items: "{{droplets.results}}"
|
||||
when: "{{ state == 'present' }}"
|
||||
|
||||
@@ -1,46 +1,46 @@
|
||||
{% for instance in droplets.results %}
|
||||
node{{loop.index}} ansible_ssh_host={{instance.droplet.ip_address}}
|
||||
{{instance.droplet.name}} ansible_ssh_host={{instance.droplet.ip_address}}
|
||||
{% endfor %}
|
||||
|
||||
{% if mode is defined and mode == "separate" %}
|
||||
[kube-master]
|
||||
node1
|
||||
{{droplets.results[0].droplet.name}}
|
||||
|
||||
[kube-node]
|
||||
node2
|
||||
{{droplets.results[1].droplet.name}}
|
||||
|
||||
[etcd]
|
||||
node3
|
||||
{{droplets.results[2].droplet.name}}
|
||||
|
||||
[vault]
|
||||
node3
|
||||
{{droplets.results[2].droplet.name}}
|
||||
{% elif mode is defined and mode == "ha" %}
|
||||
[kube-master]
|
||||
node1
|
||||
node2
|
||||
{{droplets.results[0].droplet.name}}
|
||||
{{droplets.results[1].droplet.name}}
|
||||
|
||||
[kube-node]
|
||||
node3
|
||||
{{droplets.results[2].droplet.name}}
|
||||
|
||||
[etcd]
|
||||
node2
|
||||
node3
|
||||
{{droplets.results[1].droplet.name}}
|
||||
{{droplets.results[2].droplet.name}}
|
||||
|
||||
[vault]
|
||||
node2
|
||||
node3
|
||||
{{droplets.results[1].droplet.name}}
|
||||
{{droplets.results[2].droplet.name}}
|
||||
{% else %}
|
||||
[kube-master]
|
||||
node1
|
||||
{{droplets.results[0].droplet.name}}
|
||||
|
||||
[kube-node]
|
||||
node2
|
||||
{{droplets.results[1].droplet.name}}
|
||||
|
||||
[etcd]
|
||||
node1
|
||||
{{droplets.results[0].droplet.name}}
|
||||
|
||||
[vault]
|
||||
node1
|
||||
{{droplets.results[0].droplet.name}}
|
||||
{% endif %}
|
||||
|
||||
[k8s-cluster:children]
|
||||
|
||||
Reference in New Issue
Block a user