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

CFE-2889: cf-remote info, install, packages #3488

Merged
merged 6 commits into from
Jan 16, 2019

Conversation

olehermanse
Copy link
Member

@olehermanse olehermanse commented Jan 11, 2019

olehermanse@OHMBP-1880 ~ $ cf-remote info -H 34.248.141.126

ubuntu@34.248.141.126
OS           : ubuntu (debian)
Architecture : x86_64
CFEngine     : Not installed
Binaries     : dpkg, apt

olehermanse@OHMBP-1880 ~ $ cf-remote packages hub deb
3.12.1 LTS (default)
3.10.5 LTS
Using 3.12.1 LTS (default):
Downloading package: /Users/olehermanse/.cfengine/cf-remote/packages/cfengine-nova-hub_3.12.1-1_amd64.deb
olehermanse@OHMBP-1880 ~ $ cf-remote install --hub 34.248.141.126 --package /Users/olehermanse/.cfengine/cf-remote/packages/cfengine-nova-hub_3.12.1-1_amd64.deb

ubuntu@34.248.141.126
OS           : ubuntu (debian)
Architecture : x86_64
CFEngine     : Not installed
Binaries     : dpkg, apt

Copying '/Users/olehermanse/.cfengine/cf-remote/packages/cfengine-nova-hub_3.12.1-1_amd64.deb' to '34.248.141.126'
Installing 'cfengine-nova-hub_3.12.1-1_amd64.deb' on '34.248.141.126'
CFEngine 3.12.1 was successfully installed on 34.248.141.126
olehermanse@OHMBP-1880 ~ $ cf-remote info -H 34.248.141.126

ubuntu@34.248.141.126
OS           : ubuntu (debian)
Architecture : x86_64
CFEngine     : 3.12.1
Binaries     : dpkg, apt

olehermanse@OHMBP-1880 ~ $ 

@olehermanse olehermanse added the WIP Work in Progress label Jan 11, 2019
@olehermanse
Copy link
Member Author

Replaces cfengine/starter_pack#19

@olehermanse olehermanse force-pushed the cf-remote branch 2 times, most recently from 8b2db22 to 2960b63 Compare January 14, 2019 12:41
@olehermanse olehermanse changed the title WIP CFE-2889: cf-remote CFE-2889: cf-remote Jan 14, 2019
@olehermanse olehermanse removed the WIP Work in Progress label Jan 14, 2019
@olehermanse olehermanse changed the title CFE-2889: cf-remote CFE-2889: cf-remote info, install, packages Jan 14, 2019
@olehermanse
Copy link
Member Author

@craigcomstock @vpodzime I added some examples of what's currently working in description. Please review.

craigcomstock
craigcomstock previously approved these changes Jan 14, 2019
Copy link
Contributor

@craigcomstock craigcomstock left a comment

Choose a reason for hiding this comment

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

Seems like an awful lot of very useful functions in here, such as for deployment tests and such. Like parsing releases json and various other utils. Maybe pull those things together at some point if we can.

contrib/cf-remote/cf_remote/main.py Show resolved Hide resolved
Copy link
Contributor

@vpodzime vpodzime left a comment

Choose a reason for hiding this comment

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

Looks good to me otherwise.

.gitignore Show resolved Hide resolved
contrib/cf-remote/cf_remote/main.py Outdated Show resolved Hide resolved
contrib/cf-remote/cf_remote/main.py Outdated Show resolved Hide resolved
contrib/cf-remote/cf_remote/main.py Show resolved Hide resolved
contrib/cf-remote/cf_remote/main.py Show resolved Hide resolved
contrib/cf-remote/cf_remote/utils.py Show resolved Hide resolved
contrib/cf-remote/cf_remote/utils.py Outdated Show resolved Hide resolved
if hub:
install_host(hub, hub=True, package=package)
for host in (clients or []):
install_host(host, hub=False, package=package)
Copy link
Contributor

Choose a reason for hiding this comment

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

So it's going to be the same package for hub and clients? How?

Copy link
Member Author

Choose a reason for hiding this comment

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

If you specify --package it will be the same for all hosts, yes. Trying to do a little MVP here / minimal iterations :) The idea is that you won't have to pick the package name, it can be chosen automatically. Would you prefer if I also add --hub-package and --client-package ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is okay if this iteration (MVP) requires the user to run the tool twice, once for the hub and once for the hosts. But I think we should avoid installing hub packages on hosts.

Copy link
Member Author

Choose a reason for hiding this comment

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

So I can add some error checking to make sure that isn't possible. And also add the two options for completeness.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it already done somewhere? I cannot find it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added in a separate commit now.

contrib/cf-remote/cf_remote/packages.py Show resolved Hide resolved
contrib/cf-remote/cf_remote/packages.py Outdated Show resolved Hide resolved
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
cf-remote is a python + fabric tool to log in to remote hosts
you have ssh access to. It will be used to download, transfer,
and install cfengine packages as well as bootstrapping etc.
This first iteration includes the `info` command, which prints
basic information about a remote host.

Ticket: CFE-2889
Changelog: Commit
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
The first version of this command does not pick a package
automatically, the file has to be specified with
--package argument.

Changelog: Commit
Ticket: CFE-2889
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
This command can download the necessary packages for use with
install command. For example:

$ cf-remote packages deb hub

Will download the default version hub package for debian.

Changelog: Commit
Ticket: CFE-2889
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
@olehermanse
Copy link
Member Author

@vpodzime addressed all your comments and added a commit for the new package options. Please review again.

Copy link
Contributor

@vpodzime vpodzime left a comment

Choose a reason for hiding this comment

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

Looks good to me now.

@olehermanse olehermanse merged commit b15e9be into cfengine:master Jan 16, 2019
@olehermanse olehermanse deleted the cf-remote branch January 16, 2019 15:02
@olehermanse olehermanse restored the cf-remote branch January 16, 2019 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants