Use hammer in Red Hat Satellite 6 without a password

To use hammer without a password, we have to store the credentials in a file under the users home directory.

On the server you have hammer installed create a file called ~/.hammer/cli_config.yml

$ mkdir -p ~/.hammer/log
$ vi ~/.hammer/cli_config.yml

Add the following content, replacing USERNAME and PASSWORD with the username and password for the satellite host specified by HOSTNAME.

:ui:
    :interactive: true
    :per_page: 200
    :history_file:  '~/.hammer/history'
:foreman:
    :host: 'https://HOSTNAME/'
    :username: USERNAME
    :password: PASSWORD
:log_dir: '~/.hammer/log'
:log_level: 'error'

Now we need to lock down access to the file by setting the permissions to the owner only.

$ chmod 600 ~/.hammer/cli_config.yml

You can now use hammer without specifying the username and password each time.

 

Use hammer in Red Hat Satellite 6 without a password

Install EPEL Repository on RHEL 7 / CentOS 7

In order to use the extra packages provided by EPEL, the repository needs to be added to your system.

Enable the EPEL repository

$ sudo yum-config-manager --add-repo=https://dl.fedoraproject.org/pub/epel/7/x86_64/

Download the EPEL GPG key

$ sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7

Install the GPG key

$ sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

Clean the local yum repository data

$ sudo yum clean all

And we are good to go!

Install EPEL Repository on RHEL 7 / CentOS 7

Install Ansible 2.1 on RHEL/CentOS 7 with PIP

In order to install Ansible using PIP on RHEL 7 / CentOS 7 we will configure the EPEL 7 repository, and install all of the pre-requisite packages to get Ansible up and running.

Enable the EPEL repository

$ sudo yum-config-manager --add-repo=https://dl.fedoraproject.org/pub/epel/7/x86_64/

Download the EPEL GPG key

$ sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7

Install the GPG key

$ sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

Clean the local yum repository data

$ sudo yum clean all

Install the required packages

$ sudo yum install -y python-devel libffi-devel openssl-devel gcc python-pip redhat-rpm-config

 

Update to the latest version of pip

$ sudo pip install --upgrade pip

Install paramiko

$ sudo pip install paramiko

Install Ansible

$ sudo pip install ansible

Check the version

$ ansible --version
ansible 2.1.0.0
 config file =
 configured module search path = Default w/o overrides

And we are good to go!

Install Ansible 2.1 on RHEL/CentOS 7 with PIP