solution de base, sans génération du fichier
This commit is contained in:
@@ -1,22 +1,13 @@
|
||||
---
|
||||
- name: create container
|
||||
|
||||
- name: "{{ container_prefix }} : Add"
|
||||
community.general.scaleway_compute:
|
||||
commercial_type: "{{ scw_type }}"
|
||||
region: par1
|
||||
name: "{{ container_name }}"
|
||||
state: running
|
||||
api_token: "{{ scw_api_secret_key }}"
|
||||
image: "{{ scw_image}}"
|
||||
project: "{{ scw_api_default_project_id }}"
|
||||
state: "running"
|
||||
api_token: "{{ secret_key }}"
|
||||
image: "{{ container_image}}"
|
||||
project: "{{ 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 }}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user