script to add az as tags automatically from juju status
This commit is contained in:
		@@ -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
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user