Hello,
I write playbook and python code to run it.Code i took from ansible-playbook as example:
playbook=params[“playbook”]
inventory=ansible.inventory.Inventory(hosts)
inventory.set_playbook_basedir(os.path.dirname(playbook))
stats = callbacks.AggregateStats()
playbook_cb = callbacks.PlaybookCallbacks(verbose=utils.VERBOSITY)
runner_cb = callbacks.PlaybookRunnerCallbacks(stats, verbose=utils.VERBOSITY)
params[“inventory”]=inventory
params[“stats”]=stats
params[“callbacks”]=playbook_cb
params[“runner_callbacks”]=runner_cb
pb=ansible.playbook.PlayBook(**playbook_params)
pr=pb.run()
But I got:
TASK: [base | Install packages] ***********************************************
ok: [127.0.0.1] => (item=build-essential) => {
“item”: “build-essential”,
“msg”: “install build-essential state=present update_cache=yes cache_valid_time=86400”
}
I want run playbooks without output. How to do this?
Regards.