Coder Social home page Coder Social logo

Comments (2)

89luca89 avatar 89luca89 commented on May 26, 2024

We could setup the declaration of the interfaces this way:

              ifaces_example:
                iface_1:
                  name: ens0
                  type: "nat"
                  ip: 192.168.122.12
                  # mac_address: ...
                iface_2:
                  name: ens1
                  type: "bridge"
                  ip: 192.168.124.199
                  # mac_address: ...
                iface_3:
                  name: ens2
                  type: "bridge"
                  ip: 10.80.80.23
                  # mac_address: ...

and then in te terraform use this to template

{% for iface in ifaces_example %}

    {% if ifaces_example[iface].type  == "nat" %}
        # uses static  IP
        network_interface {
        network_name   = "{{ network_name }}"
        hostname       = var.hostname
        addresses      = ["{{ ifaces_example[iface].ip }}"]

        {% if ifaces_example[iface].mac_address  is defined %}
            mac            = "{{ ifaces_example[iface].mac_address }}"
        {% endif %}

        wait_for_lease = true
        }

    {% elif ifaces_example[iface].type == "bridge" %}

        network_interface {
        bridge  = "{{ ifaces_example[iface].name }}"
        hostname = var.hostname
        }
    {% elif ifaces_example[iface].type == "bridge" %}

        network_interface {
        macvtap  = "{{ ifaces_example[iface].name }}"
        hostname = var.hostname
        }
    {% endif %}

{% endfor %}

from terrible.

89luca89 avatar 89luca89 commented on May 26, 2024

Working on the implementation in branch 1_networking_refactor,
we need to implement the network restarting phase that is proper to the various distro's network management.

from terrible.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.