美文网首页
jenkins ansible pipeline

jenkins ansible pipeline

作者: _fishman | 来源:发表于2020-02-27 21:48 被阅读0次
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} "
                
                    }
                }
            }
        }
    }
}

相关文章

网友评论

      本文标题:jenkins ansible pipeline

      本文链接:https://www.haomeiwen.com/subject/oryfhhtx.html