Compare commits
No commits in common. "55f37b979229cc1b5e95162721c9522fb5dbc8fa" and "4fdba43dd65b785601372c31ba76f5eb80df1aea" have entirely different histories.
55f37b9792
...
4fdba43dd6
11 changed files with 4 additions and 193 deletions
|
@ -89,6 +89,7 @@ ipv4_import=
|
||||||
if [ -f "${__object:?}"/parameter/ipv4-import ];
|
if [ -f "${__object:?}"/parameter/ipv4-import ];
|
||||||
then
|
then
|
||||||
ipv4_import="$(cat "${__object:?}"/parameter/ipv4-import)"
|
ipv4_import="$(cat "${__object:?}"/parameter/ipv4-import)"
|
||||||
|
echo "FOO" >&2
|
||||||
fi
|
fi
|
||||||
export ipv4_import
|
export ipv4_import
|
||||||
|
|
||||||
|
|
|
@ -15,17 +15,12 @@ autoconfigure IPv6 hosts, this type is a rudimentary implementation to generate
|
||||||
configuration for Bird to do so.
|
configuration for Bird to do so.
|
||||||
|
|
||||||
|
|
||||||
REQUIRED PARAMETERS
|
REQUIRED MULTIPLE PARAMETERS
|
||||||
-------------------
|
----------------------------
|
||||||
interface
|
interface
|
||||||
The interfaces to activate the protocol on. RAs will be sent using the
|
The interfaces to activate the protocol on. RAs will be sent using the
|
||||||
prefixes configured on these interfaces.
|
prefixes configured on these interfaces.
|
||||||
|
|
||||||
OPTIONAL PARAMETERS
|
|
||||||
-------------------
|
|
||||||
mtu
|
|
||||||
An optional MTU setting to include in the router advertisements.
|
|
||||||
|
|
||||||
|
|
||||||
OPTIONAL MULTIPLE PARAMETERS
|
OPTIONAL MULTIPLE PARAMETERS
|
||||||
----------------------------
|
----------------------------
|
||||||
|
@ -46,7 +41,6 @@ EXAMPLES
|
||||||
|
|
||||||
__bird_radv datacenter \
|
__bird_radv datacenter \
|
||||||
--interface eth1 \
|
--interface eth1 \
|
||||||
--mtu 9000 \
|
|
||||||
--route ::/0 \
|
--route ::/0 \
|
||||||
--ns 2001:DB8:cafe::4 \
|
--ns 2001:DB8:cafe::4 \
|
||||||
--ns 2001:DB8:cafe::14 \
|
--ns 2001:DB8:cafe::14 \
|
||||||
|
|
|
@ -55,12 +55,6 @@ then
|
||||||
DNSSL=$(sed -e 's/^/\tdnssl "/' -e 's/$/";/' "${__object:?}/parameter/dnssl")
|
DNSSL=$(sed -e 's/^/\tdnssl "/' -e 's/$/";/' "${__object:?}/parameter/dnssl")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
MTU=
|
|
||||||
if [ -f "${__object:?}/parameter/mtu" ];
|
|
||||||
then
|
|
||||||
MTU=$(cat "${__object:?}/parameter/mtu")
|
|
||||||
fi
|
|
||||||
|
|
||||||
__file "${confdir:?}/radv-${__object_id:?}.conf" \
|
__file "${confdir:?}/radv-${__object_id:?}.conf" \
|
||||||
--mode 0640 --owner root --group bird \
|
--mode 0640 --owner root --group bird \
|
||||||
--source - << EOF
|
--source - << EOF
|
||||||
|
@ -77,9 +71,7 @@ protocol radv ${__object_id:?} {
|
||||||
propagate routes ${have_routes:?};
|
propagate routes ${have_routes:?};
|
||||||
ipv6 { table radv_routes; export all; };
|
ipv6 { table radv_routes; export all; };
|
||||||
|
|
||||||
interface "$(cat "${__object:?}/parameter/interface")" {
|
$(sed -e 's/^/\tinterface "/' -e 's/$/";/' "${__object:?}/parameter/interface")
|
||||||
$MTU
|
|
||||||
};
|
|
||||||
|
|
||||||
$RDNS
|
$RDNS
|
||||||
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
mtu
|
|
|
@ -1,20 +0,0 @@
|
||||||
#!/bin/sh -e
|
|
||||||
#
|
|
||||||
# 2022 Joachim Desroches (joachim.desroches@epfl.ch)
|
|
||||||
#
|
|
||||||
# This file is part of cdist.
|
|
||||||
#
|
|
||||||
# cdist is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# cdist is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
systemctl enable systemd-networkd
|
|
|
@ -1,68 +0,0 @@
|
||||||
cdist-type__systemd-network(7)
|
|
||||||
==============================
|
|
||||||
|
|
||||||
NAME
|
|
||||||
----
|
|
||||||
cdist-type__systemd-network - Configure systemd.network(5) file.
|
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTION
|
|
||||||
-----------
|
|
||||||
|
|
||||||
This type allows you to configure network interfaces by generating a
|
|
||||||
systemd.network(5) file. It will enable systemd-networkd, so be sure to remove
|
|
||||||
any conflicting network configuration tool if appropriate!
|
|
||||||
|
|
||||||
Note that the systemd.network(5) system is very complete, and this type does
|
|
||||||
not aim at providing every possible option. Are currently available only the
|
|
||||||
most common options: feel free to add anything you need to this type which
|
|
||||||
hopefully will grow over time.
|
|
||||||
|
|
||||||
|
|
||||||
REQUIRED PARAMETERS
|
|
||||||
-------------------
|
|
||||||
None.
|
|
||||||
|
|
||||||
|
|
||||||
OPTIONAL PARAMETERS
|
|
||||||
-------------------
|
|
||||||
description
|
|
||||||
A text field used when displaying details about this network.
|
|
||||||
|
|
||||||
OPTIONAL MULTIPLE PARAMETERS
|
|
||||||
----------------------------
|
|
||||||
match-name
|
|
||||||
A text field that will be set in the `Name` option of the `[Match]` section.
|
|
||||||
|
|
||||||
|
|
||||||
BOOLEAN PARAMETERS
|
|
||||||
------------------
|
|
||||||
ipv6ra-usedomains
|
|
||||||
Set the `UseDomains` option of the `[IPv6AcceptRA]` section to `True`.
|
|
||||||
|
|
||||||
|
|
||||||
EXAMPLES
|
|
||||||
--------
|
|
||||||
|
|
||||||
.. code-block:: sh
|
|
||||||
|
|
||||||
# TODO
|
|
||||||
__systemd-network
|
|
||||||
|
|
||||||
|
|
||||||
SEE ALSO
|
|
||||||
--------
|
|
||||||
`cdist-type_systemd-resolved`\ (7)
|
|
||||||
`systemd.network`\ (5)
|
|
||||||
|
|
||||||
AUTHORS
|
|
||||||
-------
|
|
||||||
Joachim Desroches <joachim.desroches@epfl.ch>
|
|
||||||
|
|
||||||
|
|
||||||
COPYING
|
|
||||||
-------
|
|
||||||
Copyright \(C) 2022 Joachim Desroches. You can redistribute it
|
|
||||||
and/or modify it under the terms of the GNU General Public License as
|
|
||||||
published by the Free Software Foundation, either version 3 of the
|
|
||||||
License, or (at your option) any later version.
|
|
|
@ -1,84 +0,0 @@
|
||||||
#!/bin/sh -e
|
|
||||||
#
|
|
||||||
# 2022 Joachim Desroches (joachim.desroches@epfl.ch)
|
|
||||||
#
|
|
||||||
# This file is part of cdist.
|
|
||||||
#
|
|
||||||
# cdist is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# cdist is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
|
||||||
|
|
||||||
os=$(cat "${__global:?}/explorer/os")
|
|
||||||
|
|
||||||
case "$os" in
|
|
||||||
'debian' | 'ubuntu' | 'archlinux')
|
|
||||||
:
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
printf "Your operating system (%s) is currently not supported by systemd-network\n" "$os" >&2
|
|
||||||
printf "Please contribute an implementation for it if you can.\n" >&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# XXX: Please keep the option parsing organized in order per-section, with
|
|
||||||
# sections in the same order as they are in the manpage. This will make hacking
|
|
||||||
# and maintaining this type much easier.
|
|
||||||
|
|
||||||
output_file="${__object:?}/files/${__object_id:?}.network"
|
|
||||||
|
|
||||||
cat << EOF > "$output_file"
|
|
||||||
# This file is managed by cdist. Do not edit by hand!
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Match section
|
|
||||||
# Ensure section is needed, OR existence of optional params.
|
|
||||||
if [ -f "${__object:?}/parameter/match-name" ];
|
|
||||||
then
|
|
||||||
printf "\n[Match]\n" >> "$output_file"
|
|
||||||
|
|
||||||
if [ -f "${__object:?}/parameter/match-name" ];
|
|
||||||
then
|
|
||||||
sed -e 's/^/Name=/' \
|
|
||||||
"${__object:?}/parameter/match-name" >> "$output_file"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Network section
|
|
||||||
# Ensure section is needed, OR existence of optional params.
|
|
||||||
if [ -f "${__object:?}/parameter/description" ];
|
|
||||||
then
|
|
||||||
printf "\n[Network]\n" >> "$output_file"
|
|
||||||
|
|
||||||
if [ -f "${__object:?}/parameter/description" ];
|
|
||||||
then
|
|
||||||
sed -e 's/^/Description=/' \
|
|
||||||
"${__object:?}/parameter/description" >> "$output_file"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# IPv6AcceptRA section
|
|
||||||
# Ensure section is needed, OR existence of optional params.
|
|
||||||
if [ -f "${__object:?}/parameter/ipv6ra-usedomains" ];
|
|
||||||
then
|
|
||||||
printf "\n[IPv6AcceptRA]\n" >> "$output_file"
|
|
||||||
|
|
||||||
if [ -f "${__object:?}/parameter/ipv6ra-usedomains" ];
|
|
||||||
then
|
|
||||||
printf "UseDomains=True\n" >> "$output_file"
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
__file "/etc/systemd/network/${__object_id:?}.network" \
|
|
||||||
--source "$output_file"
|
|
|
@ -1 +0,0 @@
|
||||||
ipv6ra-usedomains
|
|
|
@ -1 +0,0 @@
|
||||||
description
|
|
|
@ -1 +0,0 @@
|
||||||
match-name
|
|
Loading…
Reference in a new issue