Files
sib_api/sib.scw_container/tasks/main.yml
2023-10-12 22:09:42 +02:00

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 }}"