From 8642e8bce3530d2deb6b02895c08edd291eea48f Mon Sep 17 00:00:00 2001 From: Chad Smith Date: Mon, 2 Nov 2020 07:20:30 -0700 Subject: doc: add example query commands to debug Jinja templates (#645) --- doc/rtd/topics/instancedata.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'doc/rtd/topics') diff --git a/doc/rtd/topics/instancedata.rst b/doc/rtd/topics/instancedata.rst index 255245a4..1850982c 100644 --- a/doc/rtd/topics/instancedata.rst +++ b/doc/rtd/topics/instancedata.rst @@ -592,6 +592,22 @@ see only redacted values. % cloud-init query --format 'cloud: {{ v1.cloud_name }} myregion: {{ % v1.region }}' + # Locally test that your template userdata provided to the vm was rendered as + # intended. + % cloud-init query --format "$(sudo cloud-init query userdata)" + + # The --format command renders jinja templates, this can also be used + # to develop and test jinja template constructs + % cat > test-templating.yaml <