diff options
author | zsdc <taras@vyos.io> | 2023-12-27 12:57:12 +0200 |
---|---|---|
committer | zdc <zdc@users.noreply.github.com> | 2023-12-27 13:51:15 +0200 |
commit | 531cbdcffd2fda1a0be11588c7a785dd9afb7665 (patch) | |
tree | a8dc809bfc127e2200ac6a22b461c73ed22c6204 | |
parent | 07825901d1ebb483ac6edc39e0a4c224fad82638 (diff) | |
download | vyos-vm-images-531cbdcffd2fda1a0be11588c7a785dd9afb7665.tar.gz vyos-vm-images-531cbdcffd2fda1a0be11588c7a785dd9afb7665.zip |
Added `copy-custom-files` role.
Sometimes we need to add extra files, like configurations. This role allows to
copy them into the installation directory.
-rw-r--r-- | README.md | 6 | ||||
-rw-r--r-- | files/custom_files/.gitkeep | 0 | ||||
-rw-r--r-- | qemu.yml | 1 | ||||
-rw-r--r-- | roles/copy-custom-files/tasks/main.yml | 7 | ||||
-rw-r--r-- | roles/copy-custom-files/tests/inventory | 2 | ||||
-rw-r--r-- | roles/copy-custom-files/tests/test.yml | 4 |
6 files changed, 20 insertions, 0 deletions
@@ -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 @@ -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 |