1. Proposed title of this feature request
Satellite 5 to 6 migration using Ansible
2. Who is the customer behind the request?
Account: name and acct # <- please include both
TAM customer: yes
CSM customer: no
3. What is the nature and description of the request?
To be able to simply migrate clients from Satellite 5 to Satellite 6 using ansible playbooks
4. Why does the customer need this? (List the business requirements here)
Thousands of systems needed to be migrated.
5. How would the customer like to achieve this? (List the functional requirements here)
Using a supported ansible playbook.
6. For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.
- Register client to Satellite 5
- Run playbook to migrate client to Satellite 6
7. Is there already an existing RFE upstream or in Red Hat Bugzilla?
8. Does the customer have any specific timeline dependencies and which release would they like to target (i.e. RHEL5, RHEL6)?
All releases, before Satellite 5 EOL
9. Is the sales team involved in this request and do they have any additional input?
10. List any affected packages or components.
11. Would the customer be able to assist in testing this functionality if implemented?
Any reason why https://github.com/Katello/katello-client-bootstrap/blob/master/bootstrap.yml wouldn't work? All we'd need to do is package/test it.
Updating component to bootstrap to package upstream playbook.
[root@sat-6-5-qa-rhel7 ~]# rpm -q katello-client-bootstrap
[root@sat-6-5-qa-rhel7 ~]# man katello-client-bootstrap
No manual entry for katello-client-bootstrap
[root@sat-6-5-qa-rhel7 ~]# katello-client-bootstrap -h
-bash: katello-client-bootstrap: command not found
[root@sat-6-5-qa-rhel7 ~]# which katello-client-bootstrap
/usr/bin/which: no katello-client-bootstrap in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/root/bin)
[root@sat-6-5-qa-rhel7 ~]# rpm -qd katello-client-bootstrap
[root@sat-6-5-qa-rhel7 ~]# less /usr/share/doc/katello-client-bootstrap-1.7.0/README.md
* Python2 >= 2.5 or 2.4 with python-simplejson installed
* subscription-manager (if the machine has no previous subscription)
* subscription-manager-migration >= 1.14.2 (if the machine is subscribed to Satellite 5 or Red Hat Classic)
# Ansible integration
The `bootstrap.yml` file contains a playbook for [Ansible](https://www.ansible.com/) which can be used to copy `bootstrap.py` to the target machine and execute it there with predefined parameters.
So I should test that be copying and editing this:
[root@sat-6-5-qa-rhel7 ~]# less /usr/share/doc/katello-client-bootstrap-1.7.0/bootstrap.yml
I was able to register a host to Satellite, but the last line of the ansible log says:
rhel7.localhost.example.com : ok=3 changed=0 unreachable=0 failed=1
I have asked Evgeni to review that to see why it says "failed=1", but its seems out of scope for this bug as the bootstrap.yml file is present as mentioned in comment 5 and it works with minor config edits as expected.
I copied and then edited local copy of bootstrap.yml as follows:
- hosts: rhel7.localhost.example.com
bootstrap_org: "Default Organization"
bootstrap_location: "Default Location"
rhel7.localhost.example.com in /etc/ansible/hosts
Thanks to Evgeni for these tips:
Added: stdout_callback = yaml in "/etc/ansible/ansible.cfg"
and used this command to get clear command output:
~]# ANSIBLE_NOCOLOR=1 ansible-playbook bootstrap.yml | tee -a ansible.log
Re failed=1 in comment 6
Its because of this line in the log:
[[91mERROR[0m], [2019-02-04 16:12:17], EXITING: [/usr/bin/yum -y install katello-agent] failed to execute properly.
which is because you're subscribing into a content view that has no katello-agent packages
for this test that is not relevant, that is an optional package
you can pass "--skip katello-agent" to skip that step
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.