-
Notifications
You must be signed in to change notification settings - Fork 2k
Conversation
return nil | ||
} | ||
|
||
func (provisioner *RedHatProvisioner) isAWS() bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure about this. On AWS the extras have to be configured with a separate command. Perhaps there is a better way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh really? Very interesting. We should ping Nirmal and see what he thinks.
Also, what is this endpoint? We should probably at least put a comment saying what it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are using RHEL with a subscription you can use the Docker docs to install. However, on EC2, that command doesn't work -- you have to use the above. I'm assuming it's subscription related.
// the extras repo different than a standalone rhel box | ||
|
||
repoCmd := "subscription-manager repos --enable=rhel-7-server-extras-rpms" | ||
if provisioner.isAWS() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not check whether we're on AWS by attempting a typecast of the driver to amazonec2.Driver
like so:
if _, err := provisioner.Driver.(amazonec2.Driver); err != nil {
// do AWS-specific logic
} else {
// do logic for everyone else
}
Admittedly this won't work for generic
, so maybe we could fall back on the other method in that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think the typecast is better. Thx!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we deal with RHEL7 like distros?
d54e8b1
to
6ca06a7
Compare
|
||
// request tty -- fixes error with hosts that use | ||
// "Defaults requiretty" in /etc/sudoers - I'm looking at you RedHat | ||
if err := session.RequestPty("xterm-256color", termHeight, termWidth, modes); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should set the terminal to os.Getenv("TERM")
and default to xterm
I just put in #1096. It's for RancherOS support, but as a part of that work I refactored the ubuntu provisioner out into a GenericProvisioner and UbuntuProvision. Seem like this code could also embed the GenericProvisioner I created. |
6ca06a7
to
c466ae3
Compare
c466ae3
to
298af59
Compare
@@ -999,6 +999,21 @@ Options: | |||
|
|||
The DigitalOcean driver will use `ubuntu-14-04-x64` as the default image. | |||
|
|||
#### exoscale |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For alphabetical order, or...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it was listed out of order from one of the rebases.
Hi, I few days ago, I started coding a FedoraProvisioner for docker-machine. Then I realized this pull request for a (very similar) Redhat provisioner was already in progress. However, there are some differences. So, I adapted by using the code for this pull request (from the redhat-provisioning branch of ehazlett/machine), and modifying it to allow integration of my code for Fedora. To do so, I split the RedhatProvisioner into two parts, one containing code that is generic to all redhat-family distributions, and another that seems specific to RHEL only. With that done, it was a trivial matter to add a new Fedora provisioner, which others may find useful. Code is here https://github.com/RusDavies/machine/tree/provisioner-fedora. Important parts are the files redhat_family.go, redhat_family_RHEL.go, and redhat_family_fedora.go, all under libmachine/provision. I've been using the resulting FedoraProvisioner on Amazon E2, using the standard Fedora 21 cloud images. It seems to works fine. Clearly, however, more thorough testing is required. At this point I'd like to engage in discussion about the acceptability of this adaptation/extension of the RedhatProvisioner code for inclusion in docker-machine. However, given the RedhatProvisioner code itself hasn't yet been merged, then I'm not sure of the best way to proceed. Which of the following is preferable:
Thanks :o) |
@ehazlett at this point, can this provisioner be a generic for both redhat + centos + fedora? or are they very different? |
@sthulb , there are some items in this RedhatProvisioner that seem very specific to RHEL only, such as the configureRepos(). Likewise for isAWS(), and installOfficialDocker(). Usage of these RHEL specific methods are hard coded into the Provision() procedure. However, the differences between RHEL and Fedora seem minor. If a suitable interface is provided, that can be assigned in an embedding structure, thereby allowing virtual dispatch overrides, then those differences can be lifted out into overriding methods in the embedding structure that are called at specific points in the provisioning process. Makes it nice and DRY. That's what I've done in my code (see comment before yours). |
@RusDavies i have actually been working on Fedora and CentOS provisioners based off of RHEL. @sthulb yeah there are some minor differences. @RusDavies you can see the branch here: ehazlett/machine@redhat-provisioning...ehazlett:fedora-provisioner It's pretty lightweight. |
@ehazlett , I thought I may be too late to the game. Good to know it's coming, anyway. :o) Some questions:
Thanks UPDATE: Just tried the commands in configureRepos() on a Fedora machine:
Thus, FedoraProvisioner will work if isAWS() returns true, but will fail otherwise. So, at least, maybe gate the call to configureRepos()? |
@RusDavies thanks for the feedback. It's not done (I've experienced the same issues in Fedora as well) but I pushed to show the work. It most likely won't make it in for 0.3.0 as we have a bunch of testing for RHEL yet. The problem with the RedHat distros is each one configures things slightly different then with various repos. This multiplies when you add more flavors. |
@ehazlett , no problem. I'm a happy to help. The slight variance between Redhat friends is precisely my concern. As support for other friends are added, it may tend towards a spaghetti of gates and exceptions. I've updated my own code to more closely match your branch with the FedoraProvisioner. Take another look: using an interface, as I have, to place hooks in the process really doesn't add much complexity, but does help to create separation between distribution specifics. Oh, and one other thing... given my use-cases tend to involve compliance concerns, seeing a "--nogpgcheck" on a yum command makes me frown just a little ;o) |
@RusDavies actually after looking we don't need |
@ehazlett , ok, fair enough. |
@ehazlett, more feedback ... RedhatProvisioner.installOfficialDocker() fails if docker is already installed from a different source. This can happen when using "--driver generic" to connect to an existing machine, or otherwise using a custom image, in either case where docker may already be installed from e.g. distribution repos. Worth noting, at least in my case, and likely for others, machines are deployed against a BOM which includes software versions. If I have an AMI that includes a particular version of docker, then I don't necessarily want to change the version or source. In my case, this important not just for consistency & stability, but also for compliance reasons. If docker is already present on the target machine, can we just use it? Trivial gate would be to do the install as: provisioner.SSHCommand(fmt.Sprintf("sudo sh -c 'type /bin/docker || yum install -y --nogpgcheck %s'", provisioner.DockerRPMPath)) |
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
…cation Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
17efb95
to
a8e2cd7
Compare
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
@ehazlett Evan
The error output for provisioning my ubuntu image is
And I think the logic of the Output method also has some problem for the command will be executed twice. Does it work as expected?
Thanks |
@sthulb do you know what is causing the Native to have issues? @nathanleclaire is the |
Mmm, yeah that |
@nathanleclaire thx |
} | ||
|
||
// update OS -- this is needed for libdevicemapper and the docker install | ||
if _, err := provisioner.SSHCommand("sudo yum -y update"); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to make this step be conditional/take a shorter amount of time? I already have a mirror on the local network, but this is taking up most of the setup time.
Unfortunately this depends on the provider and mirror. If you have a local mirror then that's about all you can do. We must update as some images do not contain the proper device mapper libs that are needed. |
Hi @ehazlett, I'm trying to use the generic driver on RHEL 7.1... I have the following setup: SSK keys already authorized on the host
Command to create host fails while importing keysAfter a few seconds, the command to create and use the generic driver fails..
What should I do? |
Refactor ntpd to support multiple servers
This enables Machine to provision RedHat (RHEL). Tested on RHEL 7.0.
Refs #905