From 64e234429279d707d9a84cbab06a962045c81661 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20=C4=8Cuchran?= <396462@mail.muni.cz>
Date: Thu, 2 Feb 2017 14:57:29 +0100
Subject: [PATCH] Upload new file

---
 Openstack/pv176.yaml | 104 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 104 insertions(+)
 create mode 100644 Openstack/pv176.yaml

diff --git a/Openstack/pv176.yaml b/Openstack/pv176.yaml
new file mode 100644
index 0000000..b2eec8d
--- /dev/null
+++ b/Openstack/pv176.yaml
@@ -0,0 +1,104 @@
+heat_template_version: '2016-04-08'
+
+parameters:
+    flavor:
+        type: string
+        default: m1.large
+    safe_mode_administrator_password:
+      default: P@ssw0rd
+      description: The safe mode administration password
+      type: string
+      constraints:
+        - length: { min: 8, max: 64 }
+        - allowed_pattern: "(?=^.{6,255}$)((?=.*\\d)(?=.*[A-Z])(?=.*[a-z])|(?=.*\\d)(?=.*[^A-Za-z0-9])(?=.*[a-z])|(?=.*[^A-Za-z0-9])(?=.*[A-Z])(?=.*[a-z])|(?=.*\\d)(?=.*[A-Z])(?=.*[^A-Za-z0-9]))^.*"
+          description: must contain letters numbers and symbols
+
+        
+resources:
+  internal_net:
+    type: OS::Neutron::Net
+    properties:
+        name: PV176-private-network
+  internal_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: internal_net }
+      cidr: "10.0.0.0/8"
+      dns_nameservers: [ "147.251.4.3", "8.8.8.8" ]
+      ip_version: 4
+      enable_dhcp: false
+      name: PV176-private-subnet
+  internal_router:
+    type: OS::Neutron::Router
+    properties:
+      external_gateway_info: { network: public-float-21 }
+      name: PV176-router
+  internal_interface:
+    type: OS::Neutron::RouterInterface
+    properties:
+      router_id: { get_resource: internal_router }
+      subnet: { get_resource: internal_subnet }
+  full_access_secgroup:
+    type: OS::Neutron::SecurityGroup
+    properties:
+      name: PV176-security-group-MUNI
+      rules:
+        - protocol: tcp
+          remote_ip_prefix: 147.251.0.0/16
+          port_range_min: 1
+          port_range_max: 65000
+        - protocol: tcp
+          remote_ip_prefix: 10.0.0.0/8
+          port_range_min: 1
+          port_range_max: 65000
+          
+  instance_port_1:
+    type: OS::Neutron::Port
+    properties:
+      name: PV176-port-1
+      network: {get_resource: internal_net}
+      security_groups:
+        - default
+        - { get_resource: full_access_secgroup }
+    
+  floating_ip_1:
+    type: OS::Nova::FloatingIP
+    properties:
+      pool: public-float-21
+  
+  Server_1:
+    type: OS::Nova::Server
+    properties:
+      name: PV176-server-1
+      flavor: { get_param: flavor }
+      image: 73ff33dc-346d-46c8-8786-3bbc97e21c64  
+      networks:
+            - port: { get_resource: instance_port_1 }    
+      user_data:
+        str_replace:
+          template: |
+            #ps1_sysnative
+            $ErrorActionPreference = 'Stop'
+            $user = [ADSI]'WinNT://./Administrator'          
+            $user.SetPassword('safe_mode_administrator_password')
+            NET USER pv176 safe_mode_administrator_password /add
+            NET LOCALGROUP Administrators pv176 /add
+            $IP = "10.0.0.2"
+            $MaskBits = 8
+            $Gateway = "10.0.0.1"
+            $Dns = "147.251.4.33"
+            $IPType = "IPv4"
+            $adapter = Get-NetAdapter | ? {$_.Status -eq "up"}      
+            $adapter | New-NetIPAddress -AddressFamily $IPType -IPAddress $IP -PrefixLength $MaskBits -DefaultGateway $Gateway           
+            $adapter | Set-DnsClientServerAddress -ServerAddresses $DNS
+            exit 1001
+          params:
+            safe_mode_administrator_password: { get_param: safe_mode_administrator_password }
+          
+                
+  association_1:
+    type: OS::Nova::FloatingIPAssociation
+    properties:
+      floating_ip: { get_resource: floating_ip_1 }
+      server_id: { get_resource: Server_1 }
+        
\ No newline at end of file
-- 
GitLab