Posts

AWS - Basic EC2 / Snapshot Cleanup

Image
As you migrate from AWS to Azure ;) you may find that you need to clear up resources to save costs.

For example, you may continue to incur costs for snapshots after you de-provision your EC2 instances (virtual machines, for the lamen).

To clear out the snapshots you can use the AWS Powershell commands to clear out any snapshot older then 90 days.

See the example below - by default Get-EC2Snapshot will show all public snapshots, so the -owner self switch is required.
Get-EC2Snapshot -Owner self | ? { $_.StartTime -lt $(get-date).adddays(-90)} | Remove-EC2Snapshot  This command may show an error indicating that a Snapshot is still in use.
Remove-EC2Snapshot : The snapshot snap-xxxxxx is currently in use by ami-xxxxxxx

Configuration Management with Salt Stack on Windows - Part 3 - Basic Configuration Management of Windows with Salt

Image
In part 3 we're going to just scratch the surface of remote execution in Salt. We're going to accept the keys for the master server and  run basic tasks using the built in modules.

The minion automatically tries to contact the Master server. The master server must approve the minions "keys" before it can be managed.

On the master server you can view the keys by using the command
sudo salt-key -L
As you can see we need to accept the "keys"

You can accept the key by using the command
sudo salt-key -a WIN-R7RQM4ENMHS

Configuration Management with Salt Stack on Windows - Part 2 - Configuring Salt Minion with Vagrant

Image
This is part two of a series of basic configuration management for Saltstack for use in an Windows environment. In this guide we'll be covering the basics of setting up Salt Stack Windows minion on a test machine on Vagrant. Part 3 we will be diving into the meat and pushing some buttons automatically with the Salt Master.

In order to create a test minion, we'll be using a Windows Server 2012 R2 vagrant image.
https://app.vagrantup.com/mwrock/boxes/Windows2012R2

vagrant init mwrock/Windows2012R2 vagrant up  Once the machine is online you can login with vagrant / vagrant.

The download for the salt minion can be found on

https://repo.saltstack.com/#windows

Or the direct link:

https://repo.saltstack.com/windows/Salt-Minion-2017.7.2-Py2-AMD64-Setup.exe

The Windows installer is straightforward - just enter the Master IP or Hostname for the Salt server. We're not going over the internet, so I entered the Private IP. If you use the default "hostname" option, it will…

Configuration Management with Salt Stack on Windows - Part 1 - Installing Salt Stack Server with Vagrant

Image
This is part one of a series of basic configuration management for Saltstack for use in an Windows environment. In this guide we'll be covering the basics of setting up Salt Stack Server with a test machine on Vagrant. It's important to note that the "master" server of Salt must be run on a Linux sever, with their being support for a ton of different operating systems as minions. Part 2 will descibe setting up a Windows minion.

We'll be grabbing the recently updated generic Ubuntu 16.04 vagrant box as a starting point
https://app.vagrantup.com/generic/boxes/ubuntu1604

Run the following commands to start this box:
vagrant init generic/ubuntu1604 vagrant up