23 lines
679 B
YAML
23 lines
679 B
YAML
---
|
|
- name: create container
|
|
community.general.scaleway_compute:
|
|
commercial_type: "{{ scw_type }}"
|
|
name: "{{ container_name }}"
|
|
state: running
|
|
api_token: "{{ scw_api_secret_key }}"
|
|
image: "{{ scw_image}}"
|
|
project: "{{ scw_api_default_project_id }}"
|
|
public_ip: dynamic
|
|
wait: true
|
|
region: "{{ scw_region }}"
|
|
register: "container_info"
|
|
|
|
- name: "generate host list"
|
|
ansible.builtin.lineinfile:
|
|
create: yes
|
|
path: "hostlist.yml"
|
|
line: " - { record_name: {{ item.msg.name}}, record_value: {{ item.msg.public_ip.address }} }"
|
|
state: present
|
|
loop: "{{ container_info.results }}"
|
|
|