mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-03-26 21:33:05 +00:00
utils/ansible-ipa-[server,replica,client]-install: New --ansible-verbose option
This option defines the verbose level for the internal ansible-playbook run.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user