summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md6
-rw-r--r--files/custom_files/.gitkeep0
-rw-r--r--qemu.yml1
-rw-r--r--roles/copy-custom-files/tasks/main.yml7
-rw-r--r--roles/copy-custom-files/tests/inventory2
-rw-r--r--roles/copy-custom-files/tests/test.yml4
6 files changed, 20 insertions, 0 deletions
diff --git a/README.md b/README.md
index 4837894..4990b39 100644
--- a/README.md
+++ b/README.md
@@ -144,6 +144,12 @@ You need to copy the ISO image with VyOS to /tmp/vyos.iso before running ansible
-e custom_packages=true
```
+- Copy custom files. All files from inside the `files/custom_files/` directory will be copied to the target filesystem recursively:
+
+ ```
+ -e custom_files=true
+ ```
+
- Enable DHCP on eth0 (default: `false`):
```
diff --git a/files/custom_files/.gitkeep b/files/custom_files/.gitkeep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/files/custom_files/.gitkeep
diff --git a/qemu.yml b/qemu.yml
index 10b9a82..5b44cca 100644
--- a/qemu.yml
+++ b/qemu.yml
@@ -29,6 +29,7 @@
- install-cloud-init-wrapper
- install-guest-agent-wrapper
- install-custom-packages-wrapper
+ - copy-custom-files
- fstrim
- unmount-pre
- create-pxe-archive
diff --git a/roles/copy-custom-files/tasks/main.yml b/roles/copy-custom-files/tasks/main.yml
new file mode 100644
index 0000000..11e12c0
--- /dev/null
+++ b/roles/copy-custom-files/tasks/main.yml
@@ -0,0 +1,7 @@
+- name: Copy custom files to the system, preserving paths
+ become: true
+ copy:
+ src: "files/custom_files/"
+ dest: "{{ vyos_install_root }}"
+ force: true
+ when: custom_files is defined
diff --git a/roles/copy-custom-files/tests/inventory b/roles/copy-custom-files/tests/inventory
new file mode 100644
index 0000000..878877b
--- /dev/null
+++ b/roles/copy-custom-files/tests/inventory
@@ -0,0 +1,2 @@
+localhost
+
diff --git a/roles/copy-custom-files/tests/test.yml b/roles/copy-custom-files/tests/test.yml
new file mode 100644
index 0000000..2163c5d
--- /dev/null
+++ b/roles/copy-custom-files/tests/test.yml
@@ -0,0 +1,4 @@
+---
+- hosts: localhost
+ roles:
+ - copy-custom-files