<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: How can I detect if ambari-server setup has already been ran in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-can-I-detect-if-ambari-server-setup-has-already-been-ran/m-p/268758#M206400</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/68765"&gt;@maxolasersquad&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One very basic test we can do to verify if the "ambari-server setup" was performed or not is to look for JDBC settings.&lt;/P&gt;&lt;P&gt;For example when we simply install ambari server binary on a host then the ambari.properties file will not have any JDBC configs so the output for the following will be empty.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt; (&lt;STRONG&gt;no output&lt;/STRONG&gt; on a server where ambari-server setup was not executed)&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# grep 'jdbc' /etc/ambari-server/conf/ambari.properties&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;However, on a server where setup was executed you will see atleast some jdbc settings as following:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# grep 'jdbc' /etc/ambari-server/conf/ambari.properties 
custom.mysql.jdbc.name=mysql-connector-java.jar
custom.oracle.jdbc.name=ojdbc8.jar
previous.custom.mysql.jdbc.name=mysql-jdbc-driver.jar
server.jdbc.connection-pool=internal
server.jdbc.database=postgres
server.jdbc.database_name=ambari
server.jdbc.postgres.schema=ambari
server.jdbc.user.name=ambari
server.jdbc.user.passwd=${alias=ambari.db.password}&lt;/LI-CODE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Aug 2019 23:36:24 GMT</pubDate>
    <dc:creator>jsensharma</dc:creator>
    <dc:date>2019-08-22T23:36:24Z</dc:date>
    <item>
      <title>How can I detect if ambari-server setup has already been ran</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-can-I-detect-if-ambari-server-setup-has-already-been-ran/m-p/268751#M206395</link>
      <description>&lt;P&gt;I am creating ansible scripts to bootstrap our ambari servers. I need to check if &lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7"&gt;ambari-server setup&lt;/FONT&gt;&amp;nbsp;has already been ran so that re-running the ansible scripts do not error out when it gets to that step. The easiest way to make these idempotent in ansible is to check for the existence of a file, but I haven't been able to find any obvious file created by the setup process that I can rely on.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2019 15:36:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-can-I-detect-if-ambari-server-setup-has-already-been-ran/m-p/268751#M206395</guid>
      <dc:creator>maxolasersquad</dc:creator>
      <dc:date>2019-08-23T15:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: How can I detect if ambari-server setup has already been ran</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-can-I-detect-if-ambari-server-setup-has-already-been-ran/m-p/268758#M206400</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/68765"&gt;@maxolasersquad&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One very basic test we can do to verify if the "ambari-server setup" was performed or not is to look for JDBC settings.&lt;/P&gt;&lt;P&gt;For example when we simply install ambari server binary on a host then the ambari.properties file will not have any JDBC configs so the output for the following will be empty.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt; (&lt;STRONG&gt;no output&lt;/STRONG&gt; on a server where ambari-server setup was not executed)&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# grep 'jdbc' /etc/ambari-server/conf/ambari.properties&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;However, on a server where setup was executed you will see atleast some jdbc settings as following:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# grep 'jdbc' /etc/ambari-server/conf/ambari.properties 
custom.mysql.jdbc.name=mysql-connector-java.jar
custom.oracle.jdbc.name=ojdbc8.jar
previous.custom.mysql.jdbc.name=mysql-jdbc-driver.jar
server.jdbc.connection-pool=internal
server.jdbc.database=postgres
server.jdbc.database_name=ambari
server.jdbc.postgres.schema=ambari
server.jdbc.user.name=ambari
server.jdbc.user.passwd=${alias=ambari.db.password}&lt;/LI-CODE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2019 23:36:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-can-I-detect-if-ambari-server-setup-has-already-been-ran/m-p/268758#M206400</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2019-08-22T23:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: How can I detect if ambari-server setup has already been ran</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-can-I-detect-if-ambari-server-setup-has-already-been-ran/m-p/268829#M206433</link>
      <description>&lt;P&gt;Perfect. Here's my solution based on your feedback.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;- name: Check if Ambari setup has already run&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; command: grep 'jdbc' /etc/ambari-server/conf/ambari.properties&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; register: ambari_setup_check&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; check_mode: no&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; ignore_errors: yes&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; changed_when: no&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;- name: Setup Ambari server&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; command: printf '%s\n' y ambari y y n | ambari-server setup -j /usr/lib/jvm/java-8-&amp;nbsp; openjdk-amd64&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; become: yes&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; when: ambari_setup_check.rc == 1&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2019 19:53:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-can-I-detect-if-ambari-server-setup-has-already-been-ran/m-p/268829#M206433</guid>
      <dc:creator>maxolasersquad</dc:creator>
      <dc:date>2019-08-23T19:53:59Z</dc:date>
    </item>
  </channel>
</rss>

