Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dustymabe opened this issue Nov 6, 2019 · 6 comments · May be fixed by #986
Open

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

dustymabe opened this issue Nov 6, 2019 · 6 comments · May be fixed by #986
Labels
jira for syncing to jira

Comments

@dustymabe
Copy link
Member

dustymabe commented Nov 6, 2019

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.

@dustymabe dustymabe changed the title Seems like systemd units should be able to specify contents:source:data like files section RFE: systemd units able to specify contents:source:data like files section Nov 6, 2019
@ajeddeloh
Copy link
Contributor

👍 I agree. While we're at it we ought to make ignition.config.{merge,replace} work the same way too. This could go into the 3.1.0 spec.

@arithx arithx linked a pull request May 18, 2020 that will close this issue
@hynd
Copy link

hynd commented Jun 16, 2020

This would be super useful for pulling unit definitions from a remote source too. What are the chances it could make it into v3_2_experimental (and FCC)?

@darkmuggle
Copy link
Contributor

I'd be interested in picking this up.

@darkmuggle darkmuggle self-assigned this Jun 17, 2020
@darkmuggle darkmuggle added the jira for syncing to jira label Jun 17, 2020
@bgilbert
Copy link
Contributor

@darkmuggle See #986.

@darkmuggle darkmuggle removed their assignment Jun 17, 2020
@darkmuggle
Copy link
Contributor

Indeed @arithx has it. Nevermind, then.

@arithx
Copy link
Contributor

arithx commented Jun 18, 2020

@darkmuggle that PR itself still needs some love (needs to update the translation code & probably fix unit tests). I initially threw it up as-is to open a discussion on whether or not the trade off of losing validation was worth the gain.

If you want to take it from it's current state and drive it to completion I'd be more than happy to cede it over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira for syncing to jira
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants