feat: add task to attach host to local networks
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
10815baadf
commit
cc424171f7
@ -22,6 +22,14 @@ hcloud_server_default_ssh_keys: []
|
|||||||
|
|
||||||
# @var hcloud_server_default_api_token: $ "_unset_"
|
# @var hcloud_server_default_api_token: $ "_unset_"
|
||||||
|
|
||||||
|
hcloud_server_networks: []
|
||||||
|
# @var hcloud_server_networks:example: >
|
||||||
|
# hcloud_server_networks:
|
||||||
|
# - name: network-1
|
||||||
|
# ip: 10.0.0.1
|
||||||
|
# state: present
|
||||||
|
# @end
|
||||||
|
|
||||||
hcloud_server_volumes: []
|
hcloud_server_volumes: []
|
||||||
# @var hcloud_server_volumes:example: >
|
# @var hcloud_server_volumes:example: >
|
||||||
# hcloud_server_volumes:
|
# hcloud_server_volumes:
|
||||||
|
@ -28,11 +28,23 @@
|
|||||||
|
|
||||||
- name: Populate instance config
|
- name: Populate instance config
|
||||||
set_fact:
|
set_fact:
|
||||||
hcloud_instance: {
|
hcloud_instance:
|
||||||
'instance': "{{ __hcloud_job.hcloud_server.name }}",
|
{
|
||||||
'ipv4': "{{ __hcloud_job.hcloud_server.ipv4_address }}",
|
"instance": "{{ __hcloud_job.hcloud_server.name }}",
|
||||||
'ipv6': "{{ __hcloud_job.hcloud_server.ipv6 }}",
|
"ipv4": "{{ __hcloud_job.hcloud_server.ipv4_address }}",
|
||||||
}
|
"ipv6": "{{ __hcloud_job.hcloud_server.ipv6 }}",
|
||||||
|
}
|
||||||
|
delegate_to: localhost
|
||||||
|
|
||||||
|
- name: Attach server to local networks
|
||||||
|
hcloud_server_network:
|
||||||
|
network: "{{ item.name }}"
|
||||||
|
server: "{{ hcloud_server.name }}"
|
||||||
|
ip: "{{ item.ip }}"
|
||||||
|
state: "{{ item.state | default('present') }}"
|
||||||
|
loop: "{{ hcloud_server_networks }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ hcloud_server.name }}:{{ item.name }}"
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
|
|
||||||
- name: Create volumes
|
- name: Create volumes
|
||||||
|
Loading…
Reference in New Issue
Block a user