mirror of
https://github.com/mmumshad/ansible-playable.git
synced 2025-03-09 23:38:54 +00:00
Update server side test cases and disable client side tests for now. Integrate later.
This commit is contained in:
parent
ab295a073a
commit
9c880c0bba
13 changed files with 588 additions and 318 deletions
|
@ -86,7 +86,11 @@ export function command(req, res) {
|
|||
)
|
||||
}
|
||||
|
||||
// Creates a new Ansible in the DB
|
||||
/**
|
||||
* List Ansible Modules
|
||||
* @param req
|
||||
* @param res
|
||||
*/
|
||||
export function modules(req, res) {
|
||||
|
||||
var ansibleEngine = req.body.ansibleEngine;
|
||||
|
@ -108,6 +112,7 @@ export function modules(req, res) {
|
|||
|
||||
// Gets a single Deploy from the DB
|
||||
export function getLogs(req, res) {
|
||||
console.log("Param ID " + req.params.id);
|
||||
return Ansible.findById(req.params.id).exec()
|
||||
.then(handleEntityNotFound(res))
|
||||
.then(function(entity){
|
||||
|
@ -169,6 +174,7 @@ export function execute(req, res) {
|
|||
|
||||
var resultSent = false;
|
||||
|
||||
// Execute Ansible Playbook and return immediately with a new Job (Ansible) object
|
||||
ansibleTool.executeAnsible(logfilename, project_folder, playbook_name, inventory_file_name, tags_joined, limit_to_hosts_joined, verbose,check_mode,
|
||||
function(data){
|
||||
//res.write(data)
|
||||
|
@ -244,6 +250,7 @@ export function playbook_create(req, res) {
|
|||
function(data){
|
||||
//res.write(data);
|
||||
//res.end()
|
||||
console.log("data = " + data);
|
||||
if(!resultSent){
|
||||
resultSent = true;
|
||||
res.send(data)
|
||||
|
@ -251,6 +258,7 @@ export function playbook_create(req, res) {
|
|||
},
|
||||
function(data){
|
||||
//res.write(data)
|
||||
console.log("data = " + data);
|
||||
if(!resultSent){
|
||||
resultSent = true;
|
||||
res.status(500).send(data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue