Skip to content

RFE: systemd units able to specify contents:source:data like files section #884

Description

@dustymabe

Feature Request

With the files section we have:

* **_contents_** (object): options related to the contents of the file.
    * **_compression_** (string): the type of compression used on the contents (null or gzip). Compression cannot be used with S3.
    * **_source_** (string): the URL of the file contents. Supported schemes are `http`, `https`, `tftp`, `s3`, and [`data`][rfc2397].

But with the systemd unit section we only have:

* **_contents_** (string): the contents of the unit.

This means that I can't use a single way to define file contents for files vs systemd units. I end up with doing something like:

#!/bin/bash
SCRIPT_CONTENTS=$(base64 --wrap 0 public-ipv4.sh)
SYSTEMD_UNIT_CONTENTS=$(sed 's|$|\\\\n|g' < issuegen-public-ipv4.service | tr -d '\n')
sed -e "s|SYSTEMD_UNIT_CONTENTS|${SYSTEMD_UNIT_CONTENTS}|" \
    -e "s|SCRIPT_CONTENTS|${SCRIPT_CONTENTS}|" < config.ign.in > config.ign

where in one case I can use base64 and the other I have to replace newlines with \n.

Metadata

Metadata

Assignees

No one assigned

    Labels

    jirafor syncing to jira

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions