Skip to content
Snippets Groups Projects
Commit 8ef4ba4d authored by Goik Martin's avatar Goik Martin
Browse files

Better volume explanations

parent 0dfe1594
No related branches found
No related tags found
No related merge requests found
......@@ -1215,21 +1215,34 @@ resource "hcloud_volume" "volume01" {
<figure xml:id="sdi_cloudProvider_volumeServerIndependent">
<title>Solution: Independent resource creation</title>
<programlisting language="tf">resource "hcloud_volume" "<emphasis
role="red">volume01</emphasis>" {
size = 10
....
<informaltable border="1">
<tr>
<th><filename>main.tf</filename></th>
<th><filename>userData.yml.tpl</filename></th>
</tr>
<tr>
<td valign="top"><programlisting language="tf">resource "hcloud_volume" "<emphasis
role="red">vol01</emphasis>" {
size = 10 ....
}
resource "hcloud_server" "helloServer" {
user_data = templatefile("tpl/userData.yml", {
volume01Id = hcloud_volume.<emphasis role="red">volume01</emphasis>.id # No cycle any more
...
user_data = templatefile("userData.yml.tpl", {
<emphasis role="blue">volume01Id</emphasis> = hcloud_volume.<emphasis
role="red">vol01</emphasis>.id # No cycle
}) ...
}
resource "hcloud_volume_attachment" "main" {
volume_id = hcloud_volume.<emphasis role="red">volume01</emphasis>.id
volume_id = hcloud_volume.<emphasis role="red">vol01</emphasis>.id
server_id = hcloud_server.helloServer.id
}</programlisting>
}</programlisting></td>
<td valign="top"><programlisting language="bash">echo `/bin/ls /dev/disk/by-id/*${<emphasis
role="blue">volume01Id</emphasis>}`
/<emphasis role="red">vol01</emphasis> xfs discard,nofail,defaults 0 0 &gt;&gt; /etc/fstab</programlisting></td>
</tr>
</informaltable>
</figure>
<qandaset defaultlabel="qanda"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment