Bug 961294 - JON Agent installed using RPM cannot be silently configured
JON Agent installed using RPM cannot be silently configured
Status: CLOSED NEXTRELEASE
Product: JBoss Operations Network
Classification: JBoss
Component: Agent (Show other bugs)
JON 3.1.2
Unspecified Unspecified
high Severity high
: ER03
: JON 3.3.0
Assigned To: Stefan Negrea
Armine Hovsepyan
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-09 07:17 EDT by bkramer
Modified: 2015-09-02 20:01 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-09-19 16:31:28 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
agent_rpm_silent_config (178.79 KB, image/png)
2014-08-25 08:36 EDT, Armine Hovsepyan
no flags Details
config_not_fount_error (69.94 KB, application/octet-stream)
2014-09-10 08:34 EDT, Armine Hovsepyan
no flags Details

  None (edit)
Description bkramer 2013-05-09 07:17:39 EDT
Description of problem:
The only way to change agent configuration (RPM installation), as per Installation Guide [1] would be to run config command:

service jon-agent config

which is equivalent to:

rhq-agent.sh --cleanconfig --setup --advanced --daemon --nostart 

and will force interactive setup. However, RPM based agent installation can not be done via kickstart or satellite if interactive configuration is required. We should have something like:
 
service rhq-agent config --silent

where configuration will be done using whatever is specified in the agent.configuration file.

[1] https://access.redhat.com/site/documentation/en-US/JBoss_Operations_Network/3.1/html/Installation_Guide/changing-rpm-config.html

Version-Release number of selected component (if applicable):
JON 3.1.2

How reproducible:
Always

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Peter Larsen 2013-05-13 16:16:38 EDT
Without an unattended install option, JON cannot be provisioned as part of a Satellite setup. They impedes customers from using a Red Hat supported provisioning solution. Being able to either manually deploy the configuration file without the need to run a "post config" script, or being able to provide an answer file directly to the "post config" script is important.

Other options should include the ability to specify the user-name or a group name the agent should have access to.
Comment 3 Stefan Negrea 2014-06-20 14:59:06 EDT
A silent flag does not help at all because the agent still needs to be configured to connect to the correct server. When installed via RPM, the agent is not pre-configured to connect back to the server where it was just downloaded because the RPM comes from RHN.

So instead of a flag the user will have to pass the path to a configuration file that will then be used to do a no-prompt configuration of the agent. 

A sample command:

service jon-agent config /path/to/agent/config/agent-configuration.xml


The user can modify the default agent configuration and pass that in to the config command. The default config file is /etc/jboss-on/agent-configuration.xml


The code is now merged in master branch. 

master branch commits:
https://github.com/rhq-project/rhq/commit/dfda660ce6ca1fd84b2cc46c0b91125b65278c76

https://github.com/rhq-project/rhq/commit/e084725a2d39267ebc8813263e9a1e0994197f57

https://github.com/rhq-project/rhq/commit/1334c4334ccb9cac54dc1c90c142a2ebcaf73a02
Comment 5 Simeon Pinder 2014-07-31 11:52:16 EDT
Moving to ON_QA as available to test with brew build of DR01: https://brewweb.devel.redhat.com//buildinfo?buildID=373993
Comment 6 Armine Hovsepyan 2014-08-25 08:36:41 EDT
Created attachment 930451 [details]
agent_rpm_silent_config
Comment 7 Armine Hovsepyan 2014-08-25 08:40:39 EDT
neither config nor status for agent service is working, re-assigned, screen-shot attached
Comment 9 Simeon Pinder 2014-09-03 16:31:48 EDT
Moving to ON_QA as available for test with the following brew build:
https://brewweb.devel.redhat.com//buildinfo?buildID=381194
Comment 10 Armine Hovsepyan 2014-09-10 08:34:25 EDT
Created attachment 936127 [details]
config_not_fount_error
Comment 11 Armine Hovsepyan 2014-09-10 08:35:03 EDT
config not found error is visible, while config full path is provided
re-assigning back
Comment 13 Stefan Negrea 2014-09-19 13:11:32 EDT
This feature works as expected. 

Please refer to the following documentation about RPMs:

https://access.redhat.com/documentation/en-US/JBoss_Operations_Network/3.1/html/Installation_Guide/agent-rpms.html#differences-btwn-jars

https://access.redhat.com/documentation/en-US/JBoss_Operations_Network/3.1/html/Installation_Guide/agent-rpms.html#rpm-users


The important aspect here is that by default the agent runs as a special user/group. In your test case, the config file was not accessible to this specific user. 

There are two ways to correct the test case: 
1) Run the agent under the hudson user. Update the init script with the correct user.

2) Give jbosson-agent user or jbosson group proper access to the configuration file.
Comment 14 Stefan Negrea 2014-09-19 13:12:45 EDT
Switching back to the ER3 for re-testing since there are no further code changes required.
Comment 16 Mike Foley 2014-09-29 10:41:39 EDT
.

Note You need to log in before you can comment on or make changes to this bug.