Skip to content
Snippets Groups Projects
Commit f4680ceb authored by Thomas Woerner's avatar Thomas Woerner
Browse files

utils/ansible-ipa-[server,replica,client]-install: New --ansible-verbose option

This option defines the verbose level for the internal ansible-playbook
run.
parent 3a3fb511
No related branches found
No related tags found
No related merge requests found
......@@ -214,6 +214,12 @@ def parse_options():
help="privilege escalation method to use "
"(default=sudo), use `ansible-doc -t become -l` to "
"list valid choices.")
parser.add_argument("--ansible-verbose",
dest="ansible_verbose",
type=int, default=None,
help="privilege escalation method to use "
"(default=sudo), use `ansible-doc -t become -l` to "
"list valid choices.")
options, args = parser.parse_known_args()
......@@ -373,8 +379,12 @@ def main(options, args):
f.write(" - role: ipaclient\n")
f.write(" state: %s\n" % state)
cmd = [ 'ansible-playbook' ]
if options.ansible_verbose:
cmd.append("-"+"v"*options.ansible_verbose)
cmd.extend(['-i', inventory, playbook])
try:
returncode = run_cmd(['ansible-playbook', '-i', inventory, playbook])
returncode = run_cmd(cmd)
if returncode != 0:
raise RuntimeError()
finally:
......
......@@ -284,6 +284,12 @@ def parse_options():
help="privilege escalation method to use "
"(default=sudo), use `ansible-doc -t become -l` to "
"list valid choices.")
parser.add_argument("--ansible-verbose",
dest="ansible_verbose",
type=int, default=None,
help="privilege escalation method to use "
"(default=sudo), use `ansible-doc -t become -l` to "
"list valid choices.")
options, args = parser.parse_known_args()
......@@ -489,8 +495,12 @@ def main(options, args):
f.write(" - role: ipareplica\n")
f.write(" state: %s\n" % state)
cmd = [ 'ansible-playbook' ]
if options.ansible_verbose:
cmd.append("-"+"v"*options.ansible_verbose)
cmd.extend(['-i', inventory, playbook])
try:
returncode = run_cmd(['ansible-playbook', '-i', inventory, playbook])
returncode = run_cmd(cmd)
if returncode != 0:
raise RuntimeError()
finally:
......
......@@ -323,6 +323,12 @@ def parse_options():
help="privilege escalation method to use "
"(default=sudo), use `ansible-doc -t become -l` to "
"list valid choices.")
parser.add_argument("--ansible-verbose",
dest="ansible_verbose",
type=int, default=None,
help="privilege escalation method to use "
"(default=sudo), use `ansible-doc -t become -l` to "
"list valid choices.")
options, args = parser.parse_known_args()
......@@ -549,8 +555,12 @@ def main(options, args):
f.write(" - role: ipaserver\n")
f.write(" state: %s\n" % state)
cmd = [ 'ansible-playbook' ]
if options.ansible_verbose:
cmd.append("-"+"v"*options.ansible_verbose)
cmd.extend(['-i', inventory, playbook])
try:
returncode = run_cmd(['ansible-playbook', '-i', inventory, playbook])
returncode = run_cmd(cmd)
if returncode != 0:
raise RuntimeError()
finally:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment