summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsdc <taras@vyos.io>2020-04-22 14:20:46 +0300
committerzsdc <taras@vyos.io>2020-04-22 14:20:46 +0300
commit6d85fa21b8dee034713770c21a1e2b11bc39fc51 (patch)
treeb2ca2cc5b3e0f31c62ef2a1248b159b9326586a5
parentafca529c30e486e834ad5e98f18bfba5f40710ac (diff)
downloadvyos-vm-images-6d85fa21b8dee034713770c21a1e2b11bc39fc51.tar.gz
vyos-vm-images-6d85fa21b8dee034713770c21a1e2b11bc39fc51.zip
Added option to create an image with empty config
-rw-r--r--README.md6
-rw-r--r--roles/install-config/templates/config.boot.j24
2 files changed, 8 insertions, 2 deletions
diff --git a/README.md b/README.md
index dacf670..394a712 100644
--- a/README.md
+++ b/README.md
@@ -108,4 +108,10 @@ You need to copy the ISO image with VyOS to /tmp/vyos.iso before running ansible
```
-e keep_user=true
+ ```
+
+- Create an image with empty configuration, do not add any default settings like eth0 address, SSH service (default: false):
+
+ ```
+ -e empty_config=true
``` \ No newline at end of file
diff --git a/roles/install-config/templates/config.boot.j2 b/roles/install-config/templates/config.boot.j2
index 51e95b9..30506f8 100644
--- a/roles/install-config/templates/config.boot.j2
+++ b/roles/install-config/templates/config.boot.j2
@@ -33,7 +33,7 @@ system {
}
}
interfaces {
-{% if cloud_init == "true" %}
+{% if cloud_init == "true" and not ( empty_config is defined and empty_config == "true" ) %}
ethernet eth0 {
address dhcp
}
@@ -41,7 +41,7 @@ interfaces {
loopback lo {
}
}
-{% if cloud_init == "true" %}
+{% if cloud_init == "true" and not ( empty_config is defined and empty_config == "true" ) %}
service {
ssh {
port 22