Record date/time of VM creation

(cherry picked from commit e918ff807c)
This commit is contained in:
Jan Stodola 2019-02-05 17:08:10 +01:00 committed by Brian C. Lane
parent f6bf2cf460
commit 0d38224f12

View File

@ -97,6 +97,8 @@ rlJournalStart
rlRun -t -c "ssh-keygen -t rsa -N '' -f $SSH_KEY_DIR/id_rsa" rlRun -t -c "ssh-keygen -t rsa -N '' -f $SSH_KEY_DIR/id_rsa"
SSH_PUB_KEY=`cat $SSH_KEY_DIR/id_rsa.pub` SSH_PUB_KEY=`cat $SSH_KEY_DIR/id_rsa.pub`
now=$(date -u '+%FT%T')
TMP_DIR=`mktemp -d /tmp/composer-azure.XXXXX` TMP_DIR=`mktemp -d /tmp/composer-azure.XXXXX`
cat > $TMP_DIR/azure-playbook.yaml << __EOF__ cat > $TMP_DIR/azure-playbook.yaml << __EOF__
--- ---
@ -117,6 +119,8 @@ rlJournalStart
image: image:
name: $OS_IMAGE_NAME name: $OS_IMAGE_NAME
resource_group: $AZURE_RESOURCE_GROUP resource_group: $AZURE_RESOURCE_GROUP
tags:
"first_seen": "$now"
__EOF__ __EOF__
rlRun -t -c "ansible-playbook $TMP_DIR/azure-playbook.yaml" rlRun -t -c "ansible-playbook $TMP_DIR/azure-playbook.yaml"