-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
got allinone config building successfully in aws
- Loading branch information
1 parent
61db394
commit 01e2fa4
Showing
23 changed files
with
379 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
{ | ||
"builders": [ | ||
{ | ||
"type": "azure-arm", | ||
"client_id": "{{user `azure_client_id`}}", | ||
"client_secret": "{{user `azure_client_secret`}}", | ||
"tenant_id": "{{user `azure_tenant_id`}}", | ||
"subscription_id": "{{user `azure_subscription_id`}}", | ||
"os_type": "Windows", | ||
"image_publisher": "MicrosoftWindowsServer", | ||
"image_offer": "WindowsServer", | ||
"image_sku": "2016-Datacenter", | ||
"disk_caching_type": "ReadWrite", | ||
"communicator": "winrm", | ||
"winrm_username": "vagrant", | ||
"winrm_use_ssl": true, | ||
"winrm_insecure": true, | ||
"winrm_timeout": "60m", | ||
"vm_size": "Standard_A2_v2", | ||
"location": "UK South", | ||
"azure_tags": { | ||
"dept": "dynamics" | ||
}, | ||
"managed_image_name": "dynamics", | ||
"managed_image_resource_group_name": "allinone" | ||
} | ||
], | ||
"provisioners": [ | ||
{ | ||
"inline": [ | ||
"winrm quickconfig -q", | ||
"winrm set winrm/config/service/Auth @{Basic=\"true\"}", | ||
"winrm set winrm/config/service @{AllowUnencrypted=\"true\"}", | ||
"winrm set winrm/config/winrs @{MaxMemoryPerShellMB=\"1024\"}", | ||
"netsh advfirewall set allprofiles state off" | ||
], | ||
"type": "windows-shell" | ||
}, | ||
{ | ||
"inline": [ | ||
"powercfg /SetActive SCHEME_MIN", | ||
"cmd /c schtasks /CHANGE /TN \"\\Microsoft\\Windows\\Windows Defender\\Windows Defender Cache Maintenance\" /RL LIMITED", | ||
"cmd /c schtasks /CHANGE /TN \"\\Microsoft\\Windows\\Windows Defender\\Windows Defender Cleanup\" /RL LIMITED", | ||
"cmd /c schtasks /CHANGE /TN \"\\Microsoft\\Windows\\Windows Defender\\Windows Defender Scheduled Scan\" /RL LIMITED", | ||
"cmd /c schtasks /CHANGE /TN \"\\Microsoft\\Windows\\Windows Defender\\Windows Defender Verification\" /RL LIMITED", | ||
"Install-WindowsFeature Net-Framework-Core,Windows-Identity-Foundation -IncludeAllSubFeature -source d:/sources/sxs", | ||
"(New-Object System.Net.WebClient).DownloadFile('https://downloads.puppetlabs.com/windows/puppet6/puppet-agent-6.18.0-x64.msi', 'C:/Windows/Temp/puppet.msi')", | ||
"cmd /c start /wait msiexec /qn /i C:\\Windows\\Temp\\puppet.msi /log C:\\Windows\\Temp\\puppet.log" | ||
], | ||
"type": "powershell" | ||
}, | ||
{ | ||
"destination": "c:\\scripts\\unattend.xml", | ||
"source": "answer_files/AutoUnattend.xml", | ||
"type": "file" | ||
}, | ||
{ | ||
"destination": "c:\\ProgramData\\PuppetLabs\\puppet\\etc\\hiera.yaml", | ||
"source": "files/hiera.yaml", | ||
"type": "file" | ||
}, | ||
{ | ||
"destination": "c:\\windows\\temp\\puppet.zip", | ||
"source": "puppet.zip", | ||
"type": "file" | ||
}, | ||
{ | ||
"scripts": [ | ||
"./scripts/puppet-apply.ps1" | ||
], | ||
"type": "powershell" | ||
}, | ||
{ | ||
"inline": [ | ||
"c:\\windows\\system32\\sysprep\\sysprep /generalize /quiet /oobe /shutdown /unattend:c:\\scripts\\unattend.xml" | ||
], | ||
"type": "windows-shell" | ||
} | ||
], | ||
"variables": { | ||
"azure_client_id": "{{env `AZURE_CLIENT_ID`}}", | ||
"azure_client_secret": "{{env `AZURE_CLIENT_SECRET`}}", | ||
"azure_tenant_id": "{{env `AZURE_TENANT_ID`}}", | ||
"azure_subscription_id": "{{env `AZURE_SUBSCRIPTION_ID`}}" | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
node default { | ||
|
||
class { 'chocolatey': | ||
choco_install_timeout_seconds => 14400 | ||
} | ||
exec { 'cmd.exe /c c:\ProgramData\chocolatey\bin\choco.exe config set commandExecutionTimeoutSeconds 14400': | ||
path => $::path | ||
} | ||
|
||
} | ||
node default { | ||
|
||
class { 'chocolatey': | ||
choco_install_timeout_seconds => 14400 | ||
} | ||
exec { 'cmd.exe /c c:\ProgramData\chocolatey\bin\choco.exe config set commandExecutionTimeoutSeconds 14400': | ||
path => $::path | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
node default { | ||
|
||
include chocolatey | ||
|
||
} | ||
node default { | ||
|
||
include chocolatey | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
cmd /c if not exist c:\programdata\puppetlabs\code move c:\programdata\puppetlabs\code.build c:\programdata\puppetlabs\code | ||
powershell -file "c:\scripts\get_prefix.ps1" | ||
call puppet apply --verbose --logdest eventlog -e 'include flagman' | ||
call puppet apply --verbose --logdest eventlog -e 'include base' | ||
powershell -file "c:\scripts\cmd_apply_puppet.ps1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<%- | String $redis_ip, | ||
String $redis_pass | ||
| -%> | ||
if (!(Test-Path c:\scripts\prefix)) { | ||
$prefix='' | ||
while (!($prefix -match "^[\d\.]+$")) { | ||
$prefix=(echo "AUTH <%= $redis_pass %>" ` "GET prefix" | nc -w 1 <%= $redis_ip %> 6379) | ||
$prefix = ($prefix -match "^[\d]+$" ) | ||
if (!( "$prefix" -match "^[\d]+$" )) { | ||
$prefix='' | ||
} else { | ||
echo $prefix > c:\scripts\prefix | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
if [ "${OS}" == "Windows_NT" ] | ||
then | ||
PATH=$PATH:/c/tools/ruby27/bin:"/c/Program Files/Oracle/VirtualBox" | ||
fi | ||
|
||
export WINRM_USERNAME=administrator | ||
export WINRM_PASSWORD=$(grep admin_password ./puppet/hieradata/account/account.yaml |cut -d: -f2|sed 's/ //g') | ||
|
||
echo "admin_password: ${WINRM_PASSWORD}" > answer_files/AutoUnattend.data.yml | ||
|
||
source scripts/boxname.sh | ||
|
||
# Populate AutoUnattend.xml answer file with correct details for build | ||
mustache answer_files/AutoUnattend.data.yml answer_files/AutoUnattend.xml.template > answer_files/AutoUnattend.xml | ||
|
||
if [[ -z "$BRANCH_NAME" ]] | ||
then | ||
BRANCH_NAME=local | ||
fi | ||
|
||
echo "Removing puppet.zip and dynamics-windows-virtualbox.box" | ||
rm -vf puppet.zip dynamics-windows-virtualbox.box | ||
cd puppet | ||
zip -qr ../puppet.zip hieradata manifests modules facter | ||
cd .. | ||
packer build -force packer-azure.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.