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} "
}
}
}
}
}
}













网友评论