diff --git a/useful_landscape_commands.md b/useful_landscape_commands.md index 33d5533..c53bdea 100644 --- a/useful_landscape_commands.md +++ b/useful_landscape_commands.md @@ -44,3 +44,23 @@ do done ``` +If you're using juju, then you might find the following more useful to add tags per AZ + +```bash +#!/bin/bash + +. landscape_rc + +juju_machines=$(mktemp) + +juju machines > ${juju_machines} + +for az in $(cat ${juju_machines} | awk '{print $6}' | tail +2 | sort | uniq) +do + for host in $(cat ${juju_machines} | grep ${az} | awk '{print $4}') + do + landscape-api add-tags-to-computers title:${host} "${az}" + done +done +``` +