RedHatSatellite / satellite-clone

Utility to assist cloning an existing Satellite 6 server to a new host
GNU General Public License v3.0
37 stars 31 forks source link

Add --list-tasks #267

Closed johnpmitsch closed 6 years ago

johnpmitsch commented 6 years ago

Fixes #265

johnpmitsch commented 6 years ago

listing tasks works w/o yes/no prompt:

[root@sat-628-rhel7 ~]# satellite-clone --list-tasks
ansible-playbook -i /usr/share/satellite-clone/inventory --list-tasks /usr/share/satellite-clone/satellite-clone-playbook.yml

playbook: /usr/share/satellite-clone/satellite-clone-playbook.yml

  play #1 (satellite6): satellite6  TAGS: []
    tasks:
      satellite-clone : Fail if the destination host is not rhel7 (for migration only)  TAGS: []
      satellite-clone : find root partition's free space    TAGS: []
      debug TAGS: []
      satellite-clone : Check if root has enough space  TAGS: []
      satellite-clone : check satellite version from the config files   TAGS: []
      satellite-clone : setting fact - satellite_answers    TAGS: []
      ....

Listing tasks takes precedence over any other argument:

[root@sat-628-rhel7 ~]# satellite-clone --list-tasks --start-at-task=""
ansible-playbook -i /usr/share/satellite-clone/inventory --list-tasks /usr/share/satellite-clone/satellite-clone-playbook.yml

playbook: /usr/share/satellite-clone/satellite-clone-playbook.yml

  play #1 (satellite6): satellite6  TAGS: []
    tasks:
      satellite-clone : Fail if the destination host is not rhel7 (for migration only)  TAGS: []
      satellite-clone : find root partition's free space    TAGS: []
      debug TAGS: []
      satellite-clone : Check if root has enough space  TAGS: []
      satellite-clone : check satellite version from the config files   TAGS: []
      satellite-clone : setting fact - satellite_answers    TAGS: []
      satellite-clone : set satellite_version to 6.2 if satellite_answers.yaml exists   TAGS: []
      satellite-clone : set satellite_version to 6.1 if satellite_answers.yaml does not exist   TAGS: []
      satellite-clone : Check for config tar file   TAGS: []
     ....

normal flags still work

[root@sat-628-rhel7 ~]# satellite-clone --start-at-task="Test Satellite"
This will initiate satellite-clone. Do you want to proceed? (y/n): y
ansible-playbook -i /usr/share/satellite-clone/inventory --start-at-task Test Satellite /usr/share/satellite-clone/satellite-clone-playbook.yml

PLAY [satellite6] ****************************************************************************************************************************************************************************

TASK [Gathering Facts] ***********************************************************************************************************************************************************************