This commit is contained in:
2023-10-12 22:09:42 +02:00
parent bffc053a91
commit bdb66c69a6
12 changed files with 175 additions and 41 deletions

View File

@@ -0,0 +1,22 @@
---
- 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 }}"