Code review changes 1. Passing the module to the various functions so that they can use module.fail_json and module.exit_json methods inside. 2. Because of point 1, install and remove methods do not return anything. Instead, they use the module functions itself. 3. Move the import statement (for apt and apt_pkg) inside main function so on import error, we can use module.fail_json to print the error.
Code review changes
1. Passing the module to the various functions so that they can use module.fail_json and module.exit_json methods inside.
2. Because of point 1, install and remove methods do not return anything. Instead, they use the module functions itself.
3. Move the import statement (for apt and apt_pkg) inside main function so on import error, we can use module.fail_json to print the error.

thaim/ansible,thaim/ansible