Bug 1592570 - [RFE]: Ship Ansible Playbook for bootstrap.py as part of the katello-client-bootstrap package.
Summary: [RFE]: Ship Ansible Playbook for bootstrap.py as part of the katello-client-b...
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Bootstrap
Version: 6.3.1
Hardware: All
OS: Linux
low vote
Target Milestone: Unspecified
Assignee: Evgeni Golov
QA Contact: Stephen Wadeley
Depends On:
TreeView+ depends on / blocked
Reported: 2018-06-18 21:32 UTC by Taft Sanders
Modified: 2019-08-12 14:36 UTC (History)
7 users (show)

Fixed In Version: katello-client-bootstrap-1.6.0-2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2019-05-14 12:37:27 UTC

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:1222 None None None 2019-05-14 12:37:34 UTC
Github theforeman foreman-packaging pull 3330 None None None 2019-01-07 13:38:54 UTC

Description Taft Sanders 2018-06-18 21:32:56 UTC
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
Strategic: 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.
Satellite 5.8
Satellite 6.3
Ansible 2.5

11. Would the customer be able to assist in testing this functionality if implemented?

Comment 1 Rich Jerrido 2018-06-19 17:04:25 UTC
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.

Comment 3 Rich Jerrido 2018-09-26 12:53:16 UTC
Updating component to bootstrap to package upstream playbook.

Comment 5 Stephen Wadeley 2019-02-01 14:25:17 UTC
Hello Evgeni

[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


# Dependencies

* 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

Thank you

Comment 6 Stephen Wadeley 2019-02-05 07:56:09 UTC

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_foreman_fqdn: sat-6-5-qa-rhel7.localhost.example.com
    bootstrap_download_method: http
    bootstrap_org: "Default Organization"
    bootstrap_location: "Default Location"
    bootstrap_activationkey: "test_ak"
    bootstrap_login: "admin"
    bootstrap_password: "changeme"
    bootstrap_hostgroup: "testHG"
    bootstrap_additional_args: "--force"
    bootstrap_target_path: /root/bootstrap.py
    bootstrap_local_copy: False

I added:
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

Thank you

Comment 8 Stephen Wadeley 2019-02-05 16:09:24 UTC

Re failed=1  in comment 6

Evgeni says:

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

Thank you

Comment 11 errata-xmlrpc 2019-05-14 12:37:27 UTC
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.


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