Ejemplo n.º 1
0
def generate_ephemeral_deployment_network_configuration(node):
    """Generate cloud-init network configuration for ephemeral deployment."""
    if node.ephemeral_deployment:
        osystem = node.get_osystem()
        release = node.get_distro_series()
        network_yaml_settings = get_network_yaml_settings(osystem, release)
        network_config = NodeNetworkConfiguration(
            node,
            version=network_yaml_settings.version,
            source_routing=network_yaml_settings.source_routing,
        )
        # Render the resulting YAML.
        network_config_yaml = yaml.safe_dump(network_config.config,
                                             default_flow_style=False)
        yield "write_files", [{
            "content": network_config_yaml,
            "path": "/etc/netplan/50-maas.yaml",
        }]
        yield "runcmd", ["rm -rf /run/netplan", "netplan apply --debug"]
Ejemplo n.º 2
0
 def _render_v1_dict(self, node):
     return NodeNetworkConfiguration(node, version=1).config
Ejemplo n.º 3
0
 def _render_netplan_dict(self, node):
     return NodeNetworkConfiguration(node, version=2).config