Skip to content
Snippets Groups Projects
Commit 3d0db32e authored by matt01671's avatar matt01671
Browse files

clean:

parent e9a1f72c
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ availability_zone: melbourne-qh2-uom ...@@ -4,7 +4,7 @@ availability_zone: melbourne-qh2-uom
# Volume # Volume
volumes: volumes:
- vol_name: dbvolume1 - vol_name: dbvolume1
vol_size: 10 vol_size: 10 #CHANGE TO HIGHER WHEN READY FOR COLLECTING
- vol_name: dbvolume2 - vol_name: dbvolume2
vol_size: 10 vol_size: 10
- vol_name: dbvolume3 - vol_name: dbvolume3
......
#!/usr/bin/env bash
. ./unimelb-comp90024-2020-grp-62-openrc.sh; ansible-playbook --ask-become-pass test.yaml
\ No newline at end of file
- hosts: localhost
vars:
sg_name: question_1
sg_description: "Question 1"
sg_protocol: tcp
sg_port_min: 3306
sg_port_max: 3306
sg_remote_group: '{{ sg_name }}'
instance_names:
- name: demo-01
- name: demo-02
instance_image: 45225edb-66d8-4fd0-bf41-132a31a18166
instance_key_name: test-moh
instance_flavor: uom.mse.2c9g
instance_az: melbourne-qh2-uom
tasks:
- name: Create a security group
os_security_group:
name: '{{ sg_name }}'
description: '{{ sg_description }}'
state: present
- name: Create security group rules
os_security_group_rule:
security_group: '{{ sg_name }}'
protocol: '{{ sg_protocol }}'
port_range_min: '{{ sg_port_min }}'
port_range_max: '{{ sg_port_max }}'
remote_group: '{{ sg_remote_group }}'
state: present
- name: Add security group to instance
os_server:
name: '{{ item.name }}'
image: '{{ instance_image }}'
key_name: '{{ instance_key_name }}'
flavor: '{{ instance_flavor }}'
availability_zone: '{{ instance_az }}'
security_groups:
- '{{ sg_name }}'
- demo_ssh-adv
timeout: 600
state: present
loop: '{{ instance_names }}'
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment