Bug 1416242 - Example of storing Hammer CLI credentials specifies the wrong path
Summary: Example of storing Hammer CLI credentials specifies the wrong path
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Docs Hammer CLI Guide
Version: 6.2.2
Hardware: Unspecified
OS: Unspecified
medium
medium vote
Target Milestone: Unspecified
Assignee: Zac Dover
QA Contact: Charles Wood
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-25 03:06 UTC by Russell Dickenson
Modified: 2019-09-25 20:41 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-08 03:40:02 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Russell Dickenson 2017-01-25 03:06:23 UTC
Document URL: https://doc-stage.usersys.redhat.com/documentation/en/red-hat-satellite/6.2/single/hammer-cli-guide/#sect-CLI_Guide-Authentication

Section Number and Name: 1.2. AUTHENTICATION

Describe the issue: In step 1 the example command is prefixed "#", which is the convention for commands to be run under the `root` user's credentials. This conflicts with all the other CLI examples in the guide are prefixed "$", which indicates they're to be run by a non-root user account. If the instructions were followed as written, the credentials stored as per these instructions could not be used as they are not in the location expected by the `hammer` tool.

Suggestions for improvement: Change the prefix used in the first example command from `#` to `$`.

Comment 1 Russell Dickenson 2017-01-25 03:07:47 UTC
Stephen,

I set this BZ ticket NEEDINFO for you as I'd appreciate validation of this BZ ticket's description. Am I right in specifying the "Suggestions for improvement"?

Comment 2 Stephen Wadeley 2017-01-27 15:51:23 UTC
Hello Russell

I agree the prompt should be $ as all the commands in the guide are, correctly, as non-root user.

But also need to fix this bit:
For example, if you plan to issue hammer commands as root, issue: 

(there is actually no point in that command as those would be the default perms for root).

The whole procedure is a bit backwards, telling you to change the perms before creating and closing the file.

How about:

Step 1:

Create the file `~/.hammer/cli_config.yml` and add the following contents to the file:
~~~
:foreman:
 :host: 'https://satellite.example.com/'
 :username: 'username'
 :password: 'password'
~~~
Replace the example values with your own details. Do not use tabs in the file, always use indentation by spaces.


Step 2:

To protect your password, make sure the file is only readable by the current user:
~~~
$ chmod 600 ~/.hammer/cli_config.yml
~~~

Step 3:
Save and close the file. Now when you start hammer it will use the credentials in the ~/.hammer/cli_config.yml file. 

Important
Do not use tabs in Hammer configuration files. Always use indentation by spaces.

HTH

Comment 3 Andrew Dahms 2017-02-01 06:30:49 UTC
Assigning to Zac for review.

Comment 4 Russell Dickenson 2017-02-02 01:22:33 UTC
Stephen,

Thanks for your feedback, especially confirmation that this is an issue.

I think your suggested reworked version of the content looks good. I have only one suggested change, and that is to change the order of the admonition about spacing. Instead of opening with "Do not...", I think it reads better to open with "Use *only* spaces for indentation...".

Comment 7 Andrew Dahms 2017-02-08 03:40:02 UTC
This content is now live on the Customer Portal.

Closing.


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