Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-3464

cf-remote --remote-download - curl / download package on remote

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Done
    • Priority: Higher
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: N/A
    • Component/s: contrib: cf-remote
    • Labels:
      None

      Description

      cf-remote currently downloads packages to ~/.cfengine/cf-remote/packages/ and then uses ssh / scp to transfer the file to the host.

      We should add an option: cf-remote install --remote-download which causes cf-remote to run the appropriate curl command on the host instead. (So the package is downloaded directly to the target machine). New option should be added here:

      https://github.com/cfengine/core/blob/3bdfeec44e4957225b2ff0bcc27c277749f9abe3/contrib/cf-remote/cf_remote/main.py#L35-L47

      This function will be used to run curl on remote host:

      https://github.com/cfengine/core/blob/3bdfeec44e4957225b2ff0bcc27c277749f9abe3/contrib/cf-remote/cf_remote/ssh.py#L70

      This function can be updated to handle pkg which is a URL, not a local file path:

      https://github.com/cfengine/core/blob/3bdfeec44e4957225b2ff0bcc27c277749f9abe3/contrib/cf-remote/cf_remote/remote.py#L164-L180

      This part will need to be skipped if the new --remote-download option is used:

      https://github.com/cfengine/core/blob/3bdfeec44e4957225b2ff0bcc27c277749f9abe3/contrib/cf-remote/cf_remote/commands.py#L121-L123

      Additionally, in the case where no package URL is specified and automatic selection is done, this part needs to be skipped:

      https://github.com/cfengine/core/blob/3bdfeec44e4957225b2ff0bcc27c277749f9abe3/contrib/cf-remote/cf_remote/remote.py#L269

      (So that the package is not downloaded locally, but the URL is kept to be downloaded on the host).

      This is the part where package is transferred from local to remote:

      https://github.com/cfengine/core/blob/3bdfeec44e4957225b2ff0bcc27c277749f9abe3/contrib/cf-remote/cf_remote/remote.py#L271

      For --remote-download it can be replaced with running the curl command over ssh, as explained above.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                aleksandrychev Igor Aleksandrychev
                Reporter:
                olehermanse Ole Herman Schumacher Elgesem
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel