summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_fan.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/config/cc_fan.py')
-rw-r--r--cloudinit/config/cc_fan.py60
1 files changed, 35 insertions, 25 deletions
diff --git a/cloudinit/config/cc_fan.py b/cloudinit/config/cc_fan.py
index 50a81744..57c762a1 100644
--- a/cloudinit/config/cc_fan.py
+++ b/cloudinit/config/cc_fan.py
@@ -3,12 +3,16 @@
# Author: Scott Moser <scott.moser@canonical.com>
#
# This file is part of cloud-init. See LICENSE file for license information.
+"""Fan: Configure ubuntu fan networking"""
-"""
-Fan
----
-**Summary:** configure ubuntu fan networking
+from textwrap import dedent
+
+from cloudinit import log as logging
+from cloudinit import subp, util
+from cloudinit.config.schema import MetaSchema, get_meta_doc
+from cloudinit.settings import PER_INSTANCE
+MODULE_DESCRIPTION = """\
This module installs, configures and starts the ubuntu fan network system. For
more information about Ubuntu Fan, see:
``https://wiki.ubuntu.com/FanNetworking``.
@@ -19,31 +23,37 @@ If cloud-init sees a ``fan`` entry in cloud-config it will:
- install the package ``ubuntu-fan`` if it is not installed
- ensure the service is started (or restarted if was previously running)
-**Internal name:** ``cc_fan``
-
-**Module frequency:** per instance
-
-**Supported distros:** ubuntu
-
-**Config keys**::
-
- fan:
- config: |
- # fan 240
- 10.0.0.0/8 eth0/16 dhcp
- 10.0.0.0/8 eth1/16 dhcp off
- # fan 241
- 241.0.0.0/8 eth0/16 dhcp
- config_path: /etc/network/fan
+Additionally, the ``ubuntu-fan`` package will be automatically installed
+if not present.
"""
-from cloudinit import log as logging
-from cloudinit import subp, util
-from cloudinit.settings import PER_INSTANCE
+distros = ["ubuntu"]
+meta: MetaSchema = {
+ "id": "cc_fan",
+ "name": "Fan",
+ "title": "Configure ubuntu fan networking",
+ "description": MODULE_DESCRIPTION,
+ "distros": distros,
+ "frequency": PER_INSTANCE,
+ "examples": [
+ dedent(
+ """\
+ fan:
+ config: |
+ # fan 240
+ 10.0.0.0/8 eth0/16 dhcp
+ 10.0.0.0/8 eth1/16 dhcp off
+ # fan 241
+ 241.0.0.0/8 eth0/16 dhcp
+ config_path: /etc/network/fan
+ """
+ )
+ ],
+}
-LOG = logging.getLogger(__name__)
+__doc__ = get_meta_doc(meta)
-frequency = PER_INSTANCE
+LOG = logging.getLogger(__name__)
BUILTIN_CFG = {
"config": None,