This message was deleted.
# bolt
s
This message was deleted.
n
You could write another plugin to do the conversion. You could do something like this where
my_transform_plugin
gets the value from another plugin and converts it:
Copy code
yaml
config:
  ssh:
    proxyjump:
      _plugin: my_transform_plugin
      value:
        _plugin: aws_inventory
        [...]
h
Ah cool, feeding plugins to plugins
n
You could also abstract away the
aws_inventory
bits by having a plugin that, when invoked, returns a
_plugin: aws_inventory
block
Though then you still need another step to process that. So you could actually have it expand to the exact thing I put above haha
h
So will it iteratively evaluate until idempotent? Or what you're saying is that it won't?
n
Yeah it evaluates bottom-up and will continue to evaluate until the value no longer contains
_plugin
h
Okay I got my plugin written and it seems to be working, however when I run bolt I get an odd error. To simplify the config I removed all plugins and run this:
Copy code
yaml
---
groups:
  - name: aws
    groups:
      - name: aws_dev
        groups:
          - name: aws_dev_buster
            targets:
            - 10.225.0.216
            config:
              ssh:
                proxyjump: "admin@34.219.87.226"
And the error I'm getting is:
Copy code
stdout: '{ "items": [\n' +
    '{"target":"10.225.0.216","action":"script","object":null,"status":"failure","value":{"_error":{"details":{},"kind":"puppetlabs.tasks/connect-error","msg":"Failed to connect to 10.225.0.216: No such file or directory - ssh: ssh -l admin -W 10.225.0.216:22 34.219.87.226","issue_code":"CONNECT_ERROR"}}}\n' +
    '],\n' +
    '"target_count": 1, "elapsed_time": 0 }\n',
  stderr: '\x1B[33mCLI arguments ["host-key-check", "run-as"] might be overridden by Inventory: /deploy/inventory.yaml [ID: cli_overrides]\x1B[0m\n' +
    '\x1B[0m'
This seems to indicate that the ssh.config.proxyjump value is getting parsed in the wrong way, tho I'm not sure if it's bolt or ruby's
net/ssh/proxy/jump
doing the incorrect parsing :\
I'm expecting the ssh to be more like
ssh -J admin@34.219.87.226 -W 10.225.0.216
but it seems to be pulling the username off and not using the -J flag, so it could be the ruby lib, since bolt just passes the values thru as per https://github.com/puppetlabs/bolt/pull/805 . 🤷
I guess specifying that the user/host of the proxyjump kind of makes sense, if it first means to ssh to one and then the other, however the -J flag is more functional. Maybe I have to go with the native-ssh transport
Actually I'm just going to head off for the weekend and pick this up monday
The above error is because the
puppet/puppet-bolt
docker container doesn't have the
ssh
command, and after installing that I get a different error
{"target":"10.225.0.216","action":"script","object":null,"status":"failure","value":{"_error":{"details":{},"kind":"puppetlabs.tasks/connect-error","msg":"Failed to connect to 10.225.0.216: command failed: ssh -l admin -W 10.225.0.216:22 34.219.87.226","issue_code":"CONNECT_ERROR"}}}
But at least the bolt command DOES work on my local host, so my plugin and inventory.yaml are all good, and it's just figuring out how to make this work on the docker container