From 58544662204cfbcecb9f92e3ca0901ca7d32df6e Mon Sep 17 00:00:00 2001 From: Martin Cuchran <cuchy@Martins-MacBook-Pro-4.local> Date: Tue, 7 Feb 2017 18:06:48 +0100 Subject: [PATCH] Added ps1 to template --- Openstack/pv176-env.json | 3 ++- Openstack/pv176-init.json | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Openstack/pv176-env.json b/Openstack/pv176-env.json index 812a64a..eb6b61c 100644 --- a/Openstack/pv176-env.json +++ b/Openstack/pv176-env.json @@ -1,6 +1,7 @@ { "resource_registry":{ "Lib::private_network": "https://gitlab.ics.muni.cz/396462/PV176/raw/master/Openstack/pv176-network.template", - "Lib::server_vm": "https://gitlab.ics.muni.cz/396462/PV176/raw/master/Openstack/pv176-server.template" + "Lib::server_vm": "https://gitlab.ics.muni.cz/396462/PV176/raw/master/Openstack/pv176-server.template", + "Lib::server_init_script": "https://gitlab.ics.muni.cz/396462/PV176/raw/master/Openstack/server-init.ps1" } } \ No newline at end of file diff --git a/Openstack/pv176-init.json b/Openstack/pv176-init.json index 0e11133..bcbe51d 100644 --- a/Openstack/pv176-init.json +++ b/Openstack/pv176-init.json @@ -49,8 +49,8 @@ "port": "PV176-port-%index%" } ], - "user_data": "#ps1_sysnative;$ErrorActionPreference = 'Stop';$ip = (int)%index%+2;$adapter = Get-NetAdapter;$adapter | New-NetIPAddress -AddressFamily 'IPv4' -IPAddress '10.0.0.'+$ip -PrefixLength '8' -DefaultGateway '10.0.0.1';$adapter | Set-DnsClientServerAddress -ServerAddresses '147.251.4.33';$user = [ADSI]'WinNT://./Administrator';$user.SetPassword('Password.1');NET USER pv176 Password.1 /add;NET LOCALGROUP Administrators pv176 /add;exit 1001" - } + "user_data": {"get_file": "Lib::server_init_script"} + } } } } -- GitLab