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

[BUG] Problems with interpreting shell commands #111

Open
johnmckenna-snd opened this issue Aug 12, 2024 · 2 comments
Open

[BUG] Problems with interpreting shell commands #111

johnmckenna-snd opened this issue Aug 12, 2024 · 2 comments
Assignees
Labels
bug Something isn't working Unlabeled Requires sorting

Comments

@johnmckenna-snd
Copy link
Contributor

Please describe the issue.
I've been having some problems interpreting shell commands specifically with things like "" empty strings or | pipes.

I have found a work around using the go templating bit like this:

  generate-cert:
    cmd.run:
      - name: ssh-keygen -t ed25519 -C <comment> -q -N {{ "" }} -f <file>
      - runas: user

Additionally, there's some more weirdness depending on what you do with your command like this one for adding docker to the apt registry.

echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null

This one I work around by writing the poopy command to a shell script then running that then deleting the file, which works but is a bit clunky.

Version Information

  • Commit [
  • Systems
    • Farmer OS Distribution: [ubuntu]
    • Sprout(s) OS Distribution(s): [debian]
CLI Version:
	Tag: v1.0.4
	Commit: 42a8b65
	Arch: darwin
	Compiler: go1.22.3
Farmer Version:
	Tag: v1.0.4
	Commit: 42a8b65
	Arch: linux
	Compiler: go1.22.3

Does this bug exist on the tip of master?
[x] Yes
[ ] No

@johnmckenna-snd johnmckenna-snd added bug Something isn't working Unlabeled Requires sorting labels Aug 12, 2024
@taigrr
Copy link
Member

taigrr commented Aug 12, 2024

Does the issue still exist when you use a YAML multiline string instead of trying to get it to work in a kv value pairing?

@johnmckenna-snd
Copy link
Contributor Author

johnmckenna-snd commented Aug 12, 2024

I tried that, but the mutliline string just hangs with no errors until the cook times out. It seems like there's a parsing issue with it which I wasn't able to suss out from the code. I checked the logs with journalctl on the sprout and the cook never even got executed.

- name: |
   string
   string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Unlabeled Requires sorting
Projects
None yet
Development

No branches or pull requests

2 participants