Is there a way to check module hasn't already been added before calling adding using JBoss CLI? e.g. module add --name=org.mysql --resources=/home/abc/drivers/mysql/MySQL5.jar # Want to do similar check for module add if (outcome != success) of /subsystem=datasources/jdbc-driver=org.mysql:read-resource # Add it... end-if Reason is trying to add a module that already exists causes an error. Continue reading...