diff --git a/doc/source/configuration/host-system.rst b/doc/source/configuration/host-system.rst index e568ee69..ac480818 100644 --- a/doc/source/configuration/host-system.rst +++ b/doc/source/configuration/host-system.rst @@ -138,7 +138,8 @@ Sample Document to run containers in Containerd runtime Files ----- -A list of files to be written to the host. Files can be given as precise content or extracted from a tarball specified by url: +A list of files to be written to the host. Files can be given as precise +content, extracted from a tarball specified by url, or downloaded from a url: .. code-block:: yaml @@ -148,8 +149,10 @@ A list of files to be written to the host. Files can be given as precise conten exact text - path: /etc/from-tar - tar_url: http://example.com/file + tar_url: http://example.com/file.tgz tar_source: dir/file.txt + - path: /etc/from-url + url: http://example.com/file Images ------ diff --git a/promenade/builder.py b/promenade/builder.py index ec4b082b..5ca7eeea 100644 --- a/promenade/builder.py +++ b/promenade/builder.py @@ -54,6 +54,8 @@ class Builder: elif 'symlink' in file_spec: data = file_spec['symlink'] islink = True + elif 'url' in file_spec: + data = _fetch_tar_url(file_spec['url']) elif 'tar_url' in file_spec: data = _fetch_tar_content(file_spec['tar_url'], file_spec['tar_path']) diff --git a/promenade/schemas/Genesis.yaml b/promenade/schemas/Genesis.yaml index ea8d7623..22a38d10 100644 --- a/promenade/schemas/Genesis.yaml +++ b/promenade/schemas/Genesis.yaml @@ -23,6 +23,8 @@ data: mode: type: integer minimum: 0 + url: + $ref: '#/definitions/url' tar_url: $ref: '#/definitions/url' tar_path: @@ -35,6 +37,9 @@ data: - type: object required: - content + - type: object + required: + - url - type: object allOf: - type: object diff --git a/promenade/schemas/HostSystem.yaml b/promenade/schemas/HostSystem.yaml index 47b5183b..4fb15cd6 100644 --- a/promenade/schemas/HostSystem.yaml +++ b/promenade/schemas/HostSystem.yaml @@ -37,6 +37,8 @@ data: mode: type: integer minimum: 0 + url: + $ref: '#/definitions/url' tar_url: $ref: '#/definitions/url' tar_path: @@ -57,6 +59,9 @@ data: - type: object required: - symlink + - type: object + required: + - url - type: object allOf: - type: object