Allow for creation of multiple T-Pots

This commit is contained in:
Sebastian Haderecker 2021-02-13 20:12:58 +01:00
parent c014e9635d
commit 48e02ceb1c
2 changed files with 13 additions and 6 deletions

View file

@ -4,14 +4,21 @@
roles:
- check
- name: Deploy instance
- name: Deploy instances
hosts: localhost
vars_files: my_os_cloud.yaml
roles:
- create_net
- create_vm
tasks:
- name: Create security group and network
ansible.builtin.include_role:
name: create_net
- name: Create one or more instances
ansible.builtin.include_role:
name: create_vm
loop: "{{ range(0, 1) }}"
loop_control:
extended: yes
- name: Install T-Pot on new instance
- name: Install T-Pot
hosts: tpot
remote_user: linux
become: yes

View file

@ -2,7 +2,7 @@
ansible.builtin.set_fact:
tpot_name: "t-pot-ansible-{{ lookup('password', '/dev/null chars=ascii_lowercase,digits length=6') }}"
- name: Create instance
- name: Create instance {{ ansible_loop.index }} of {{ ansible_loop.length }}
openstack.cloud.server:
cloud: "{{ cloud }}"
name: "{{ tpot_name }}"