You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by neykov <gi...@git.apache.org> on 2016/07/05 18:07:34 UTC

[GitHub] brooklyn-server pull request #230: Fix setting the hostname on non-centos ma...

GitHub user neykov opened a pull request:

    https://github.com/apache/brooklyn-server/pull/230

    Fix setting the hostname on non-centos machines

    Failure in the command will abort machine obtain, so make sure the command reports successfull result on non-centos machines.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/neykov/brooklyn-server fix/set-hostname-ubuntu

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-server/pull/230.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #230
    
----
commit b9dc74452fe6dfe2aab05bfc14b37f854e93fd02
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Date:   2016-07-05T18:07:15Z

    Fix setting the hostname on non-centos machines
    
    Failure in the command will abort machine obtain, so make sure the command reports successfull result on non-centos machines.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server pull request #230: Fix setting the hostname on non-centos ma...

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/230#discussion_r69695478
  
    --- Diff: locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java ---
    @@ -924,9 +924,10 @@ protected MachineLocation obtainOnce(ConfigBag setup) throws NoMachinesAvailable
                             executeCommandThrowingOnError(
                                     (SshMachineLocation)machineLocation,
                                     "Generate hostname " + node.getName(),
    -                                Arrays.asList("sudo hostname " + node.getName(),
    -                                        "sudo sed -i \"s/HOSTNAME=.*/HOSTNAME=" + node.getName() + "/g\" /etc/sysconfig/network",
    -                                        "sudo bash -c \"echo 127.0.0.1   `hostname` >> /etc/hosts\"")
    +                                ImmutableList.of(BashCommands.chainGroup(
    +                                        "sudo bash -c \"echo 127.0.0.1   " + node.getName() + " >> /etc/hosts\"",
    --- End diff --
    
    Good suggestion, will implement it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server issue #230: Fix setting the hostname on non-centos machines

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on the issue:

    https://github.com/apache/brooklyn-server/pull/230
  
    Yeah, looks like the customizer is an additional step. Can we just use it from provisioning.properties instead of making it  an initiailzer?



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server issue #230: Fix setting the hostname on non-centos machines

Posted by grkvlt <gi...@git.apache.org>.
Github user grkvlt commented on the issue:

    https://github.com/apache/brooklyn-server/pull/230
  
    Why not fix [SetHostnameCustomizer](https://github.com/apache/brooklyn-server/blob/master/software/base/src/main/java/org/apache/brooklyn/entity/machine/SetHostnameCustomizer.java) for non CentOS/RHEL instead?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server pull request #230: Fix setting the hostname on non-centos ma...

Posted by grkvlt <gi...@git.apache.org>.
Github user grkvlt commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/230#discussion_r69626231
  
    --- Diff: locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java ---
    @@ -924,9 +924,10 @@ protected MachineLocation obtainOnce(ConfigBag setup) throws NoMachinesAvailable
                             executeCommandThrowingOnError(
                                     (SshMachineLocation)machineLocation,
                                     "Generate hostname " + node.getName(),
    -                                Arrays.asList("sudo hostname " + node.getName(),
    -                                        "sudo sed -i \"s/HOSTNAME=.*/HOSTNAME=" + node.getName() + "/g\" /etc/sysconfig/network",
    -                                        "sudo bash -c \"echo 127.0.0.1   `hostname` >> /etc/hosts\"")
    +                                ImmutableList.of(BashCommands.chainGroup(
    +                                        "sudo bash -c \"echo 127.0.0.1   " + node.getName() + " >> /etc/hosts\"",
    --- End diff --
    
    prefer `"echo 127.0.0.1 " + node.getName() + " | sudo tee -a /etc/hosts"` to this


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server issue #230: Fix setting the hostname on non-centos machines

Posted by grkvlt <gi...@git.apache.org>.
Github user grkvlt commented on the issue:

    https://github.com/apache/brooklyn-server/pull/230
  
    Or, copy [JcloudsHostnameCustomizer](https://github.com/brooklyncentral/clocker/blob/master/docker/src/main/java/clocker/docker/entity/util/JcloudsHostnameCustomizer.java) from Clocker, which works on most Linux OS types?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server pull request #230: Fix setting the hostname on non-centos ma...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/brooklyn-server/pull/230


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server issue #230: Fix setting the hostname on non-centos machines

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on the issue:

    https://github.com/apache/brooklyn-server/pull/230
  
    @grkvlt addressed comments. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server issue #230: Fix setting the hostname on non-centos machines

Posted by grkvlt <gi...@git.apache.org>.
Github user grkvlt commented on the issue:

    https://github.com/apache/brooklyn-server/pull/230
  
    @neykov @aledsage I _think_ `SetHostnameCustomizer` is meant to be used after this command executes in `JcloudsLocation` to fix additional CentOS/RHL issues, right?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server issue #230: Fix setting the hostname on non-centos machines

Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on the issue:

    https://github.com/apache/brooklyn-server/pull/230
  
    feels like we should be able to combine some of the commands between the two files
    
    added TODO comments in https://github.com/apache/brooklyn-server/commit/257926534101749280853455dd7e0684eaa56c27
    
    (and merged)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---