Ansible Lessons Learned

Ansible Lessons Learned

Table of Contents

Playbooks

Admin Scripts

Main repository: Admin-Scripts

Add users on RedHat Linux machines

Creates users, adds them to groups, and copys ssh key into authorized_keys

Link to playbook: add_users.yml

Register machines to a RedHat Satellite Server

Define the machines in the host inventory that you want to register. Modify the activation_key, satellite_org_id, satellite_katello_rpm, and satellite_url under group vars.

Link to playbook: register.yml

Errors

Requested Data Type Primary not Available

TASK [Install updates] *************************************************************************************************************************************************
fatal: [tower00.paas-govcloud.agilesof.org]: FAILED! => {"changed": false, "msg": "Error: requested datatype primary not available\n", "rc": 1, "results": []}

FIX: Republish the meta-data for the content view subscribed to on the RedHat Satellite Server.

Ansible Vault

Encrypt Strings

ansible-vault encrypt_string ‘mypassword’ –name ‘password’

Decrypt Strings in a file

ansible localhost -m debug -a var=’password’ -e “@file.yml” –ask-vault-pass