Skip to content

Conversation

@adreyer
Copy link
Contributor

@adreyer adreyer commented Oct 30, 2018

The following PR to the panos module shows how device tasks can be updated to use the remote transport.
puppetlabs/puppetlabs-panos#70

@puppetcla
Copy link

CLA signed by all contributors.

pcp: Bolt::Transport::Orch,
local: Bolt::Transport::Local
local: Bolt::Transport::Local,
remote: Bolt::Transport::Remote,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we expect to use this for anything other than devices? If not I think 'Device' is a more precise name, since ssh and winrm are also remote transports. But if so this might be the best name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a larger issue(or two closely related issues) I think we need to discuss and/or research.

Are all remote targets devices(ie physical devices or vms with limited control APIs)?
No, remote tasks should be used for cloud resources, notification APIs etc.

Do they use the puppet-device framework?
Usually but not always. I would expect most ruby implementations to use the puppet-device framework but they could very will be written without that especially to enable non-ruby implementations.

My general hypothesis is that module authors especially ruby authors will want to think of the modules they write as "device" modules since they use the device framework and renaming the framework is probably not worth the effort. On the other hand, I think bolt users, and eventually PE GUI admins should not think of these things as devices but rather remote targets that rely on a proxy since it's weird to call an aws account a device.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming is hard :) This seems to echo us not knowing how to refer to ephemeral, cloudy | container "nodes".

Definitely worth more discussion.

Addressable::URI.unencode_component(@uri_obj.password) || @password
end

def remote?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

device??

attr_reader :issue_code

def initialize(message, issue_code)
# TODO can we just drop issue code here?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1


def run_on_target
if remote?
raise "Target was creates without inventory? Not get_targets?" unless @inventory
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/creates/created/

I'm not sure I can parse the error message...

end

def add_target_param(target, task, params)
# TODO: How should metadata impact this?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metadata seems to be more "controllable" (and visible) to the user, so I think "prioritizing" that makes the most sense:

if !target.remote? && task.remote?
    raise Bolt::Node::RemoteError.new('Remote tasks can only be run on remote targets')
end

Raising an error if the target is remotable and the task doesn't specify it could be confusing if users don't know where the 'remotable' target is coming from.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on the other hand running a non-remote task against a remote target seems incredibly dangerous.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand what a task be "remotable" is enough to comment. For right now it just seems like "the user said in the metadata it can be run on remote targets", and if they don't specify that they still might be able to run on remote targets.

I think we can raise a warning in that case, but limiting the user to only tasks that are remote seems like it makes using remote tasks much harder.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the general statement is that a remoteable task is one that does something meaningful with the _target metaparam.

IE the service task is not remoteable. If I ran it targeting an aws account it would stop a service on the run-on node rather then do anything to the real device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants