Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packet Template for Windows Evaluation Cloud Image #47

Open
syyang-in-cloud opened this issue Aug 6, 2020 · 2 comments
Open

Packet Template for Windows Evaluation Cloud Image #47

syyang-in-cloud opened this issue Aug 6, 2020 · 2 comments
Milestone

Comments

@syyang-in-cloud
Copy link
Member

What's the issue?

  • Example Template for Windows Cloud Image (Evaluation)
  • One of 2012 R2, 2016, 2019

Definition of Done

  • Example Packer Template with Ansible
@syyang-in-cloud syyang-in-cloud self-assigned this Aug 6, 2020
@syyang-in-cloud
Copy link
Member Author

syyang-in-cloud commented Aug 10, 2020

The below is how to Ansible to Windows (winrm)
cloud-init user-data

ubuntu@ubuntu-jenkins:~/test/winrm$ cat user_win.ps1
#ps1_sysnative
$username = "ansible"
$password = "w36F9M1NAOzXNl7yfy4n"
$group = "Administrators"

& NET USER $username $password /add /y /expires:never
& NET LOCALGROUP $group $username /add
& WMIC USERACCOUNT where "Name='$username'" SET PasswordExpires=FALSE

$url = "https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1"
$file = "$env:temp\ConfigureRemotingForAnsible.ps1"
(New-Object -TypeName System.Net.WebClient).DownloadFile($url, $file)
powershell.exe -ExecutionPolicy ByPass -File $file

ubuntu@ubuntu-jenkins:~/test/winrm$
ubuntu@ubuntu-jenkins:~/test/winrm$ cat hosts
[win]
52.117.14.22

[win:vars]
ansible_user=ansible
ansible_password=w36F9M1NAOzXNl7yfy4n
ansible_port=5986
ansible_connection=winrm
ansible_winrm_server_cert_validation=ignore
ubuntu@ubuntu-jenkins:~/test/winrm$

@syyang-in-cloud syyang-in-cloud removed their assignment Sep 16, 2020
@syyang-in-cloud syyang-in-cloud added this to the TBD milestone Oct 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant