Record date/time of VM creation

Related: rhbz#1673012
This commit is contained in:
Jan Stodola 2019-02-05 17:08:10 +01:00 committed by Alexander Todorov
parent 2ebf60f28d
commit fabf428f00

View File

@ -101,6 +101,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__
--- ---
@ -121,6 +123,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"