Skip to content

Instantly share code, notes, and snippets.

{"version":1,"resource":"file:///home/sidnei/teste.go","entries":[{"id":"GNpS.go","source":"textFileCreate.source","timestamp":1653672755513},{"id":"JKJk.go","timestamp":1653672802221},{"id":"D6dO.go","timestamp":1653672833609},{"id":"cfnA.go","timestamp":1653672863453}]}
# cat deploy.yml
- hosts: localhost
gather_facts: no
roles:
- role: launch
name: win
- hosts: win
roles:
- deploy
# cat roles/terminate/tasks/main.yml
- name: ensure instances are not running
ec2:
region: "{{ target_aws_region }}"
image: "{{ win_ami_id }}"
instance_type: "{{ instance_type }}"
group_id: "{{ sg_out.group_id }}"
key_name: "{{ keypair }}"
wait: yes
wait_timeout: 500
# cat roles/build-ami/tasks/main.yml
- name: Create AMI
ec2_ami:
region: "{{ target_aws_region }}"
instance_id: "{{ item.id }}"
name: "windows-personalizado"
wait: yes
state: present
with_items: "{{ ec2_result.tagged_instances }}"
register: ami
# cat roles/deploy/files/script.ps1
# Install Chocolatey
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# Globally Auto confirm every action
choco feature enable -n allowGalobalConfirmation
# Install JDK 8 and git
choco install jdk8
choco install git
# cat roles/launch/tasks/main.yml
- name: Find Windows AMI base in this region
ec2_ami_facts:
owners: 801119661308
filters:
name: Windows_Server-2019-English-Full-Base*
register: found_amis
- name: Get AMI Windows
set_fact:
@sidneiweber
sidneiweber / deploy_main.yml
Last active December 27, 2019 21:46
deploy
# cat roles/deploy/tasks/main.yml
- name: Copy Script config
win_copy:
src: script.ps1
dest: C:\Windows\Temp\script.ps1
- name: Execute script
win_shell: C:\Windows\Temp\script.ps1
- name: ensure IIS and ASP.NET are installed
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
┌───────────────────────────┐
│Compilação do Kernel Linux │
│Para máquinas locais Debian│
└───────────────────────────┘
Autor: Jefferson Rocha <lrcjefferson@gmail.com.br>
Seção: Manual
Versão: 1.0
Atualização: 10/01/2018
Homepage: http://www.jeffersonrocha.com.br