ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odiache...@apache.org
Subject ambari git commit: AMBARI-14276. User should be able to specify password for HAWQ system user(Alexander Denissov via odiachenko).
Date Wed, 09 Dec 2015 23:31:34 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk c35b47d13 -> 58dab9f14


AMBARI-14276. User should be able to specify password for HAWQ system user(Alexander Denissov
via odiachenko).


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/58dab9f1
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/58dab9f1
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/58dab9f1

Branch: refs/heads/trunk
Commit: 58dab9f14b38d1114984feb8752e17fe09176e46
Parents: c35b47d
Author: Oleksandr Diachenko <odiachenko@pivotal.io>
Authored: Wed Dec 9 15:31:09 2015 -0800
Committer: Oleksandr Diachenko <odiachenko@pivotal.io>
Committed: Wed Dec 9 15:31:09 2015 -0800

----------------------------------------------------------------------
 .../HAWQ/2.0.0/configuration/hawq-env.xml       | 35 ++++++++++++++++++++
 .../common-services/HAWQ/2.0.0/metainfo.xml     |  1 +
 .../HAWQ/2.0.0/package/scripts/common.py        |  4 +--
 .../HAWQ/2.0.0/package/scripts/constants.py     |  1 -
 .../HAWQ/2.0.0/package/scripts/master_helper.py |  4 ++-
 .../HAWQ/2.0.0/package/scripts/params.py        |  1 +
 6 files changed, 42 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/58dab9f1/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-env.xml
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-env.xml
new file mode 100644
index 0000000..22777f1
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-env.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<configuration>
+
+  <property>
+    <name>hawq_password</name>
+    <display-name>HAWQ system user password</display-name>
+    <value></value>
+    <description>The password of HAWQ system user.
+      During cluster initialization and when provisioning new hosts, ssh keys are exchanged
using this password.
+      Initially, the HAWQ system user will be created with this password.
+      Afterwards, the password should be changed directly on the hosts first and then the
updated value must be entered here.
+    </description>
+    <value-attributes>
+      <type>password</type>
+    </value-attributes>
+  </property>
+
+</configuration>
+  
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/58dab9f1/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml
index b9d0350..8635554 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml
@@ -110,6 +110,7 @@
 
       <configuration-dependencies>
         <config-type>hawq-site</config-type>
+        <config-type>hawq-env</config-type>
         <config-type>gpcheck-env</config-type>
       </configuration-dependencies>
     </service>

http://git-wip-us.apache.org/repos/asf/ambari/blob/58dab9f1/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py
index f44b576..8a62172 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py
@@ -54,14 +54,14 @@ def setup_user():
 
 def __create_hawq_user():
   """
-  Creates HAWQ user with default password and group.
+  Creates HAWQ user with password and default group.
   """
   import params
   Group(constants.hawq_group, ignore_failures=True)
 
   User(constants.hawq_user,
        gid=constants.hawq_group,
-       password=crypt.crypt(constants.hawq_password, "salt"),
+       password=crypt.crypt(params.hawq_password, "salt"),
        groups=[constants.hawq_group, params.user_group],
        ignore_failures=True)
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/58dab9f1/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/constants.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/constants.py
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/constants.py
index ff8f4be..6edb327 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/constants.py
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/constants.py
@@ -29,7 +29,6 @@ YARN = "yarn"
 root_user = "root"
 hawq_user = "gpadmin"
 hawq_group = hawq_user
-hawq_password = hawq_user
 
 # Directories
 hawq_home_dir = "/usr/local/hawq/"

http://git-wip-us.apache.org/repos/asf/ambari/blob/58dab9f1/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py
index 71b02aa..4255573 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/master_helper.py
@@ -20,6 +20,7 @@ from resource_management.core.resources.system import File, Execute
 from resource_management.core.source import Template
 from resource_management.core.exceptions import Fail
 from resource_management.core.logger import Logger
+from resource_management.libraries.functions.format import format
 
 import utils
 import common
@@ -45,7 +46,8 @@ def __setup_passwordless_ssh():
   """
   Exchanges ssh keys to setup passwordless ssh for the hawq_user between the HAWQ Master
and the HAWQ Segment nodes
   """
-  utils.exec_hawq_operation("ssh-exkeys", "-f {0} -p {1}".format(constants.hawq_hosts_file,
constants.hawq_password))
+  import params
+  utils.exec_hawq_operation("ssh-exkeys", format('-f {hawq_hosts_file} -p {hawq_password!p}',
hawq_hosts_file=constants.hawq_hosts_file, hawq_password=params.hawq_password))
 
   File(constants.hawq_hosts_file, action='delete')
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/58dab9f1/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py
index 8d9de6e..62870f0 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/params.py
@@ -39,6 +39,7 @@ hostname = config['hostname']
 # Users and Groups
 hdfs_superuser = config['configurations']['hadoop-env']['hdfs_user']
 user_group = config['configurations']['cluster-env']['user_group']
+hawq_password = config['configurations']['hawq-env']['hawq_password']
 
 
 # HAWQ Hostnames


Mime
View raw message