Whirr
  1. Whirr
  2. WHIRR-464

Do not fail if whirr.cluster-user already exists on the remote machine

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.8.0
    • Fix Version/s: 0.7.2
    • Component/s: None
    • Labels:
      None

      Description

      I think we should not fail if whirr.cluster-user already exists on the remote machine unless it's root. This becomes a critical issue when starting a new cluster from inside Amazon as ec2-user.

      1. WHIRR-464.patch
        2 kB
        Rodrigo Duarte Sousa
      2. WHIRR-464_2.patch
        3 kB
        Rodrigo Duarte Sousa

        Activity

        Hide
        Andrei Savu added a comment -

        Here we need to change the behaviour from create user to ensure user exists.

        Show
        Andrei Savu added a comment - Here we need to change the behaviour from create user to ensure user exists.
        Hide
        Rodrigo Duarte Sousa added a comment -

        I've tried to reproduce without success. Can you share a example recipe on how to reproduce it?

        Show
        Rodrigo Duarte Sousa added a comment - I've tried to reproduce without success. Can you share a example recipe on how to reproduce it?
        Hide
        Rodrigo Duarte Sousa added a comment -

        Nevermind, I've just reproduced it =)

        Show
        Rodrigo Duarte Sousa added a comment - Nevermind, I've just reproduced it =)
        Hide
        Andrei Savu added a comment -

        Great. Let me know if you need help.

        Show
        Andrei Savu added a comment - Great. Let me know if you need help.
        Hide
        Rodrigo Duarte Sousa added a comment -

        If the user already exists it gets the user's home path as base to configure the ssh keys.

        It should works if the user doesn't have a home directory yet, because it is created and assigned the ownership, which has the same effect.

        Show
        Rodrigo Duarte Sousa added a comment - If the user already exists it gets the user's home path as base to configure the ssh keys. It should works if the user doesn't have a home directory yet, because it is created and assigned the ownership, which has the same effect.
        Hide
        Andrei Savu added a comment -

        Looks great! I'm testing the change now on aws-ec2.

        Show
        Andrei Savu added a comment - Looks great! I'm testing the change now on aws-ec2.
        Hide
        Andrei Savu added a comment -

        Here are a few improvement ideas:

        ps: make sure you mark the attachment for inclusion on upload

        Show
        Andrei Savu added a comment - Here are a few improvement ideas: rename createUserWithPublicAndPrivateKey to something like ensureUserExistsWithPublicAndPrivateKey copy the public key to .ssh/id_rsa.pub implement lock sshd. See: https://github.com/jclouds/jclouds/blob/master/scriptbuilder/src/main/java/org/jclouds/scriptbuilder/statements/ssh/SshStatements.java ps: make sure you mark the attachment for inclusion on upload
        Hide
        Rodrigo Duarte Sousa added a comment -

        New patch with suggested modifications.

        Show
        Rodrigo Duarte Sousa added a comment - New patch with suggested modifications.
        Hide
        Andrei Savu added a comment -

        +1 I will go ahead and commit.

        Show
        Andrei Savu added a comment - +1 I will go ahead and commit.
        Hide
        Andrei Savu added a comment -

        Committed to trunk and branch 0.7. Thanks Rodrigo!

        Show
        Andrei Savu added a comment - Committed to trunk and branch 0.7. Thanks Rodrigo!
        Hide
        Andrei Savu added a comment -

        Rodrigo can you create a follow-up JIRA issue as a task under WHIRR-393 to disable password based authentication?

        Show
        Andrei Savu added a comment - Rodrigo can you create a follow-up JIRA issue as a task under WHIRR-393 to disable password based authentication?
        Hide
        Rodrigo Duarte Sousa added a comment -

        Done!

        Show
        Rodrigo Duarte Sousa added a comment - Done!

          People

          • Assignee:
            Rodrigo Duarte Sousa
            Reporter:
            Andrei Savu
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development