bolt icon indicating copy to clipboard operation
bolt copied to clipboard

Apply fails when tty mode enabled on podman target

Open puppetjoy opened this issue 1 year ago • 0 comments

Describe the Bug

Enabling the tty mode for Podman exec commands results in bolt apply and apply blocks failing with:

> bolt apply -e 'notify { "Hello": }' -t podman://nest-stage1-haswell-workstation --log-level=debug
...
Starting: plan
Starting: install puppet and gather facts on podman://nest-stage1-haswell-workstation
Starting: install puppet and gather facts on podman://nest-stage1-haswell-workstation
Starting: task apply_helpers::custom_facts on podman://nest-stage1-haswell-workstation
Running task apply_helpers::custom_facts with '{"plugins":"Sensitive [value redacted]","_task":"apply_helpers::custom_facts"}' on ["podman://nest-stage1-haswell-workstation"]
Running task 'apply_helpers::custom_facts' on podman://nest-stage1-haswell-workstation
{"target":"podman://nest-stage1-haswell-workstation","action":"task","object":null,"status":"failure","value":{"_error":{"details":{},"kind":"puppetlabs.tasks/task_file_error","msg":"no implicit conversion of StringIO into String","issue_code":"WRITE_ERROR"}}}
Finished: task apply_helpers::custom_facts with 1 failure in 0.55 sec
Finished: install puppet and gather facts with 1 failure in 0.68 sec
Finished: install puppet and gather facts with 1 failure in 0.68 sec
Starting: apply catalog on
Starting: apply catalog on
Finished: apply catalog with 0 failures in 0.0 sec
Finished: apply catalog with 0 failures in 0.0 sec
Failed on 1 target: podman://nest-stage1-haswell-workstation
Ran on 1 target in 0.73 sec

Expected Behavior

Apply mode should not be affected by a setting that should only affect run_command.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Define inventory with:
    config:
      podman:
        tty: true
    
  2. Apply code to a container target.
    bolt apply -e 'notify { "Hello": }' -t podman://container-name
    

Environment

  • Bolt 4.0.0 (gem)
  • Podman 5.1.1
  • Gentoo

Additional Context

I want to use TTY mode to signal to commands that they can output in color.

puppetjoy avatar Dec 27 '24 19:12 puppetjoy