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

Enhanced private network exercise

parent 8ef4ba4d
No related branches found
No related tags found
No related merge requests found
...@@ -1227,20 +1227,24 @@ resource "hcloud_volume" "volume01" { ...@@ -1227,20 +1227,24 @@ resource "hcloud_volume" "volume01" {
role="red">vol01</emphasis>" { role="red">vol01</emphasis>" {
size = 10 .... size = 10 ....
} }
resource "hcloud_server" "helloServer" { resource "hcloud_server" "hello" {
user_data = templatefile("userData.yml.tpl", { user_data = templatefile(
<emphasis role="blue">volume01Id</emphasis> = hcloud_volume.<emphasis "userData.yml.tpl", {
role="red">vol01</emphasis>.id # No cycle # No cycle
<emphasis role="blue">volId</emphasis>=hcloud_volume.<emphasis
role="red">vol01</emphasis>.id
}) ... }) ...
} }
resource "hcloud_volume_attachment" "main" { resource "hcloud_volume_attachment"
volume_id = hcloud_volume.<emphasis role="red">vol01</emphasis>.id "main" {
server_id = hcloud_server.helloServer.id volume_id=hcloud_volume.<emphasis role="red">vol01</emphasis>.id
server_id=hcloud_server.hello.id
}</programlisting></td> }</programlisting></td>
<td valign="top"><programlisting language="bash">echo `/bin/ls /dev/disk/by-id/*${<emphasis <td valign="top"><programlisting language="bash">echo
role="blue">volume01Id</emphasis>}` `/bin/ls /dev/disk/by-id/*${<emphasis role="blue">volId</emphasis>}`
/<emphasis role="red">vol01</emphasis> xfs discard,nofail,defaults 0 0 &gt;&gt; /etc/fstab</programlisting></td> /<emphasis role="red">vol01</emphasis> xfs discard,nofail,defaults 0 0
&gt;&gt; /etc/fstab</programlisting></td>
</tr> </tr>
</informaltable> </informaltable>
</figure> </figure>
...@@ -1392,7 +1396,25 @@ resource "hcloud_network_route" "gateway"{ ...@@ -1392,7 +1396,25 @@ resource "hcloud_network_route" "gateway"{
linkend="sdi_cloudProvider_networks_qanda_httpGateway"/>.</para> linkend="sdi_cloudProvider_networks_qanda_httpGateway"/>.</para>
</note> </note>
</listitem> </listitem>
<listitem>
<para>Provide <xref linkend="glo_DNS"/> names to be used on
your two hosts locally by defining
<filename>/etc/cloud/templates/hosts.debian.tmpl</filename>
accordingly.</para>
</listitem>
</orderedlist> </orderedlist>
<tip>
<para>Variables of <code
xlink:href="https://developer.hashicorp.com/terraform/language/values/variables">type
= object</code> are your friend:</para>
<programlisting language="tf">privateSubnet = {
dnsDomainName = "intern.g3.hdm-stuttgart.cloud"
ipAndNetmask = "10.0.1.0/24"
}</programlisting>
</tip>
</question> </question>
</qandaentry> </qandaentry>
</qandadiv> </qandadiv>
......
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