๐
This file contains hidden or 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
- name: copy aws config | |
win_template: | |
src: aws_config.ps1.j2 | |
dest: 'Z:\aws_config.ps1' | |
- name: config aws sdk tools | |
win_shell: Z:\aws_config.ps1 |
This file contains hidden or 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
Set-AWSCredential -AccessKey {{lookup('env', 'AWS_ACCESS_KEY_ID')}} -SecretKey {{lookup('env', 'AWS_SECRET_ACCESS_KEY')}} -StoreAs default | |
Set-DefaultAWSRegion -Region {{aws.region}} |
This file contains hidden or 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
- name: install aws tools | |
win_package: | |
path: http://sdk-for-net.amazonwebservices.com/latest/AWSToolsAndSDKForNet.msi | |
arguments: '/quiet /qn /le Z:\aws-tools-installlog.txt' | |
product_id: '{186A6440-3AD4-4E0E-ACC2-C098CA589290}' | |
state: present | |
creates_path: 'C:\Program Files\Amazon\Ec2ConfigService' |
This file contains hidden or 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
localhost ansible_connection=local ansible_python_interpreter=python | |
[win] | |
[win:vars] | |
ansible_connection=winrm | |
ansible_ssh_port=5986 | |
ansible_ssh_user=Administrator | |
ansible_ssh_pass={{ win_initial_password }} | |
ansible_winrm_server_cert_validation=ignore |
This file contains hidden or 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
--- | |
- hosts: localhost | |
vars_files: | |
- secret.yml | |
gather_facts: no | |
tasks: | |
- name: create ec2 windows server security group | |
ec2_group: | |
name: "{{ aws.windows_security_group }}" | |
description: Windows server |
This file contains hidden or 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
<powershell> | |
$admin = [adsi]("WinNT://./administrator, user") | |
$admin.PSBase.Invoke("SetPassword", "{{ win_initial_password }}") | |
Invoke-Expression ((New-Object System.Net.Webclient).DownloadString('https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1')) | |
</powershell> |
This file contains hidden or 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
FROM williamyeh/ansible:ubuntu16.04 | |
RUN pip install --upgrade pip && \ | |
pip install boto3 && \ | |
pip install boto | |
ADD ansible /etc/ansible | |
RUN chmod +x /etc/ansible/ec2.py |
This file contains hidden or 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
java -cp jetty-util-9.2.17.v20160517.jar org.eclipse.jetty.util.security.Password password |
This file contains hidden or 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
final SslContextFactory sslContextFactory = new SslContextFactory(keyStorePath); | |
sslContextFactory.setKeyStorePassword(keyStorePassword); | |
final HttpConfiguration httpsConfiguration = new HttpConfiguration(httpConfiguration); | |
httpsConfiguration.addCustomizer(new SecureRequestCustomizer()); | |
final ServerConnector httpsConnector = new ServerConnector(server, | |
new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.asString()), | |
new HttpConnectionFactory(httpsConfiguration)); | |
httpsConnector.setPort(httpsPort); | |
server.addConnector(httpsConnector); |
This file contains hidden or 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
final Server server = new Server(); | |
final HttpConfiguration httpConfiguration = new HttpConfiguration(); | |
httpConfiguration.setSecureScheme("https"); | |
httpConfiguration.setSecurePort(httpsPort); | |
final ServerConnector http = new ServerConnector(server, | |
new HttpConnectionFactory(httpConfiguration)); | |
http.setPort(httpPort); | |
server.addConnector(http); |