From cc86483fdf7a6bd988f485c06402fd07368dd26e Mon Sep 17 00:00:00 2001 From: kumvijaya Date: Tue, 21 May 2024 16:41:14 +0530 Subject: T6357: create test repository to validate setup --- data/templates/system/cloud_init_networking.j2 | 9 +++++++++ data/templates/system/curlrc.j2 | 6 ++++++ data/templates/system/proxy.j2 | 7 +++++++ data/templates/system/ssh_config.j2 | 6 ++++++ data/templates/system/sysctl.conf.j2 | 7 +++++++ 5 files changed, 35 insertions(+) create mode 100644 data/templates/system/cloud_init_networking.j2 create mode 100644 data/templates/system/curlrc.j2 create mode 100644 data/templates/system/proxy.j2 create mode 100644 data/templates/system/ssh_config.j2 create mode 100644 data/templates/system/sysctl.conf.j2 (limited to 'data/templates/system') diff --git a/data/templates/system/cloud_init_networking.j2 b/data/templates/system/cloud_init_networking.j2 new file mode 100644 index 0000000..52cce72 --- /dev/null +++ b/data/templates/system/cloud_init_networking.j2 @@ -0,0 +1,9 @@ +network: + version: 2 + ethernets: +{% for iface in ifaces_list %} + {{ iface['name'] }}: + dhcp4: true + match: + macaddress: "{{ iface['mac'] }}" +{% endfor %} diff --git a/data/templates/system/curlrc.j2 b/data/templates/system/curlrc.j2 new file mode 100644 index 0000000..be4efe8 --- /dev/null +++ b/data/templates/system/curlrc.j2 @@ -0,0 +1,6 @@ +{% if http_client.source_interface is vyos_defined %} +--interface "{{ http_client.source_interface }}" +{% endif %} +{% if http_client.source_address is vyos_defined %} +--interface "{{ http_client.source_address }}" +{% endif %} diff --git a/data/templates/system/proxy.j2 b/data/templates/system/proxy.j2 new file mode 100644 index 0000000..0737cd3 --- /dev/null +++ b/data/templates/system/proxy.j2 @@ -0,0 +1,7 @@ +### autogenerated by system_proxy.py ### +{% if url is vyos_defined and port is vyos_defined %} +{# remove http:// prefix so we can inject a username/password if present #} +export http_proxy=http://{{ username ~ ':' ~ password ~ '@' if username is vyos_defined and password is vyos_defined }}{{ url | replace('http://', '') }}:{{ port }} +export https_proxy=$http_proxy +export ftp_proxy=$http_proxy +{% endif %} diff --git a/data/templates/system/ssh_config.j2 b/data/templates/system/ssh_config.j2 new file mode 100644 index 0000000..d3ede09 --- /dev/null +++ b/data/templates/system/ssh_config.j2 @@ -0,0 +1,6 @@ +{% if ssh_client.source_address is vyos_defined %} +BindAddress {{ ssh_client.source_address }} +{% endif %} +{% if ssh_client.source_interface is vyos_defined %} +BindInterface {{ ssh_client.source_interface }} +{% endif %} diff --git a/data/templates/system/sysctl.conf.j2 b/data/templates/system/sysctl.conf.j2 new file mode 100644 index 0000000..db699c3 --- /dev/null +++ b/data/templates/system/sysctl.conf.j2 @@ -0,0 +1,7 @@ +# autogenerated by system_sysctl.py + +{% if parameter is vyos_defined %} +{% for k, v in parameter.items() %} +{{ k }} = {{ v.value }} +{% endfor %} +{% endif %} -- cgit v1.2.3