<?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: Ansible outputs Unknown Job for ambari-agent in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ansible-outputs-Unknown-Job-for-ambari-agent/m-p/161283#M36639</link>
    <description>&lt;P&gt;I couldn't figure out that why ambari-agent module was not being recognize but i managed to use script from init.d to start the service and it worked.&lt;/P&gt;&lt;P&gt;Here is the snippet of the play:&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt; name: Ensure ambari-agent is running and enabled &lt;/P&gt;&lt;P&gt;    command: /etc/init.d/ambari-agent restart&lt;/P&gt;</description>
    <pubDate>Fri, 05 Aug 2016 16:04:02 GMT</pubDate>
    <dc:creator>bhavintandel</dc:creator>
    <dc:date>2016-08-05T16:04:02Z</dc:date>
    <item>
      <title>Ansible outputs Unknown Job for ambari-agent</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ansible-outputs-Unknown-Job-for-ambari-agent/m-p/161280#M36636</link>
      <description>&lt;P&gt;I am getting following error:&lt;/P&gt;&lt;P&gt;fatal: [node4.hc.com]: FAILED! =&amp;gt; {"changed": false, "failed": true, "msg": "stop: Unknown job: ambari-agent\nstart: Unknown job: ambari-agent\n"}&lt;/P&gt;&lt;P&gt;fatal: [node2.hc.com]: FAILED! =&amp;gt; {"changed": false, "failed": true, "msg": "stop: Unknown job: ambari-agent\nstart: Unknown job: ambari-agent\n"}&lt;/P&gt;&lt;P&gt;and role is :&lt;/P&gt;&lt;P&gt;---
- hosts: all&lt;/P&gt;&lt;P&gt;       tasks:&lt;/P&gt;&lt;P&gt;       - name: Install Ambari agent &lt;/P&gt;&lt;P&gt;         yum: name=ambari-agent state=present &lt;/P&gt;&lt;P&gt;       - name: Configure ambari-server hostname in ambari-agent configuration &lt;/P&gt;&lt;P&gt;         lineinfile: dest=/etc/ambari-agent/conf/ambari-agent.ini regexp=^.*hostname=.*$ line=hostname={{ item }} backup=yes                  with_items: "{{groups['ambari']}}"&lt;/P&gt;&lt;P&gt;       - name: Ensure ambari-agent is running and enabled&lt;/P&gt;&lt;P&gt;          service: name=ambari-agent state=started enabled=yes&lt;/P&gt;&lt;P&gt;Why is it not able to find the service ?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2016 17:55:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ansible-outputs-Unknown-Job-for-ambari-agent/m-p/161280#M36636</guid>
      <dc:creator>bhavintandel</dc:creator>
      <dc:date>2016-08-02T17:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible outputs Unknown Job for ambari-agent</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ansible-outputs-Unknown-Job-for-ambari-agent/m-p/161281#M36637</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/11975/bhavintandel.html" nodeid="11975"&gt;@Bhavin Tandel&lt;/A&gt; , &lt;/P&gt;&lt;P&gt;are all the other steps running fine ? maybe posting the whole output will help....&lt;/P&gt;&lt;P&gt;I have similar playbook, which works fine on RHEL&lt;/P&gt;&lt;PRE&gt;- name: install ambari-agent yum: name=ambari-agent state=latest 
...
- name: Ensure ambari-agent is running and enabled 
service: name=ambari-agent state=restarted enabled=yes&lt;/PRE&gt;&lt;P&gt;guessing you are on a RHEL based distro...&lt;/P&gt;&lt;P&gt;What if you do a manual "service ambari-agent restart" ?!?!&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2016 19:14:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ansible-outputs-Unknown-Job-for-ambari-agent/m-p/161281#M36637</guid>
      <dc:creator>geko</dc:creator>
      <dc:date>2016-08-02T19:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible outputs Unknown Job for ambari-agent</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ansible-outputs-Unknown-Job-for-ambari-agent/m-p/161282#M36638</link>
      <description>&lt;P&gt;Thanks &lt;A href="https://community.hortonworks.com/questions/48704/ansible-outputs-unknown-job-for-ambari-agent.html#" rel="nofollow noopener noreferrer" target="_blank"&gt;@Gerd Koenig&lt;/A&gt; for the quick reply. This the whole output, and yeah i am on Centos 6.5. If i run the command manually then it executed successfully.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="6262-conemu64-2016-08-02-14-18-49.png" style="width: 1360px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/20681i1A9084DD64A0A065/image-size/medium?v=v2&amp;amp;px=400" role="button" title="6262-conemu64-2016-08-02-14-18-49.png" alt="6262-conemu64-2016-08-02-14-18-49.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 11:54:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ansible-outputs-Unknown-Job-for-ambari-agent/m-p/161282#M36638</guid>
      <dc:creator>bhavintandel</dc:creator>
      <dc:date>2019-08-18T11:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible outputs Unknown Job for ambari-agent</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ansible-outputs-Unknown-Job-for-ambari-agent/m-p/161283#M36639</link>
      <description>&lt;P&gt;I couldn't figure out that why ambari-agent module was not being recognize but i managed to use script from init.d to start the service and it worked.&lt;/P&gt;&lt;P&gt;Here is the snippet of the play:&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt; name: Ensure ambari-agent is running and enabled &lt;/P&gt;&lt;P&gt;    command: /etc/init.d/ambari-agent restart&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 16:04:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ansible-outputs-Unknown-Job-for-ambari-agent/m-p/161283#M36639</guid>
      <dc:creator>bhavintandel</dc:creator>
      <dc:date>2016-08-05T16:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible outputs Unknown Job for ambari-agent</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ansible-outputs-Unknown-Job-for-ambari-agent/m-p/161284#M36640</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/11975/bhavintandel.html" nodeid="11975"&gt;@Bhavin Tandel&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This is a valid question.&lt;/P&gt;&lt;P&gt;Ambari 2.2.1.1 introduced a bug, by adding upstart support on all flavours of Linux: &lt;A href="https://issues.apache.org/jira/browse/AMBARI-14842" target="_blank"&gt;https://issues.apache.org/jira/browse/AMBARI-14842&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, the same /etc/init/ambari-agent.conf file was used for all flavours of Linux.
And in CentOS/RHEL6, the line 'kill signal SIGKILL' from this file is not compatible with the older version of upstart used in CentOS/RHEL6.&lt;/P&gt;&lt;P&gt;Ansible service module would always prefer to use upstart instead of SysVinit to start services, hence the error, as the upstart stop/start ambari-agent does not work in CentOS/RHEL6.&lt;/P&gt;&lt;P&gt;This is fixed in Ambari 2.2.2.0 so I suggest you use Ambari 2.2.2.0.
If you can't, then you'll need to use the following Ansible task before your service task:&lt;/P&gt;&lt;PRE&gt;- name: Fix for upstart script in RHEL6
  lineinfile: dest=/etc/init/ambari-agent.conf
              state=absent
              regexp='^kill(.*)'
  when: ansible_os_family == "RedHat" and ansible_distribution_major_version == "6"&lt;/PRE&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Alexandru &lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 20:53:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ansible-outputs-Unknown-Job-for-ambari-agent/m-p/161284#M36640</guid>
      <dc:creator>aanghel</dc:creator>
      <dc:date>2016-08-05T20:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible outputs Unknown Job for ambari-agent</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ansible-outputs-Unknown-Job-for-ambari-agent/m-p/161285#M36641</link>
      <description>&lt;P&gt;Thanks &lt;A rel="user" href="https://community.cloudera.com/users/10940/aanghel.html" nodeid="10940"&gt;@Alexandru Anghel&lt;/A&gt; &lt;/P&gt;&lt;P&gt;This was very informative&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 23:32:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ansible-outputs-Unknown-Job-for-ambari-agent/m-p/161285#M36641</guid>
      <dc:creator>bhavintandel</dc:creator>
      <dc:date>2016-08-05T23:32:33Z</dc:date>
    </item>
  </channel>
</rss>

