jenkins ansible pipeline

2020-02-27  本文已影响0人  _fishman
String deployHosts = "host1,host2"


pipeline {
    agent { node { label "deploy" }}

    stages {
        stage('deploy'){
            steps{
              script{

                hosts = deployHosts.split(",").toList()            
                for (host in hosts){
                sh " ansible -m shell -a 'free -m' ${host} "
                
                    }
                }
            }
        }
    }
}
上一篇 下一篇

猜你喜欢

热点阅读