Skip to content

Commit

Permalink
Add --list-tasks
Browse files Browse the repository at this point in the history
Fixes #265
  • Loading branch information
John Mitsch committed Nov 16, 2017
1 parent aa059b6 commit f47c96d
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions bin/satellite-clone
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ def main():
dest="step",
default=False,
help="interactive: confirm each task before running")
parser.add_argument("--list-tasks",
action="store_true",
dest="list_tasks",
default=False,
help="list tasks that will be run in the playbook")
args = parser.parse_args()

PRODUCTION_INSTALL_PATH = "/usr/share/satellite-clone"
Expand All @@ -42,8 +47,7 @@ def main():
.format(PRODUCTION_INSTALL_PATH))
exit(1)

yes_or_no("This will initiate satellite-clone. Do you want to proceed?")

confirm = False
ansible_args = []
if args.verbose:
ansible_args.append("-vvv")
Expand All @@ -52,6 +56,14 @@ def main():
ansible_args.append(args.start_at_task)
if args.step:
ansible_args.append("--step")
if args.list_tasks:
ansible_args = []
ansible_args.append("--list-tasks")
confirm = True

if not confirm:
yes_or_no("This will initiate satellite-clone. "
"Do you want to proceed?")

os.environ["ANSIBLE_CONFIG"] = os.path.join(PRODUCTION_INSTALL_PATH,
'ansible.production.cfg')
Expand Down

0 comments on commit f47c96d

Please sign in to comment.