mirror of
https://github.com/mmumshad/ansible-playable.git
synced 2025-03-09 23:38:54 +00:00
Add option to disable adding custom ansible host engine
This commit is contained in:
parent
2fc2040882
commit
f06bd10330
9 changed files with 95 additions and 54 deletions
|
@ -109,6 +109,10 @@ export function create(req, res) {
|
|||
req.body.owner_id = req.user._id;
|
||||
req.body.owner_name = req.user.name;
|
||||
|
||||
if(config.disableAnsibleHostAddition == "true" && ansibleEngine.ansibleHost && ansibleEngine.ansibleHost !== 'localhost'){
|
||||
return res.status(500).send("Unable to add a custom Ansible Engine as ENV variable DISABLE_ANSIBLE_HOST_ADDITION is set to true")
|
||||
}
|
||||
|
||||
// Set default values
|
||||
if(!ansibleEngine.ansibleHost){
|
||||
ansibleEngine = {
|
||||
|
|
|
@ -7,5 +7,6 @@ var router = express.Router();
|
|||
|
||||
router.get('/logs/server', controller.serverLogs);
|
||||
router.get('/logs/api', controller.apiLogs);
|
||||
router.get('/config/disable_ansible_host_addition', controller.getConfigDisableAnsibleHostAddition);
|
||||
|
||||
module.exports = router;
|
||||
|
|
|
@ -88,3 +88,9 @@ exports.apiLogs = function(req,res){
|
|||
})
|
||||
|
||||
};
|
||||
|
||||
exports.getConfigDisableAnsibleHostAddition = function(req,res){
|
||||
|
||||
res.send(config.disableAnsibleHostAddition);
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue