安装ansible软件
yum -y install ansible
pipeline {
agent any
options{ timestamps () }
environment {
book="/tmp/nas/test.yml"
}
stages {
stage('syntax-check') {
steps {
ansiblePlaybook (
//inventory: '${hos}',
colorized: true,
playbook: '${book}',
limit: '10.22.8.33,10.22.32.2',
extras: '--syntax-check'
)
}
}
stage('Deloy') {
steps {
ansiblePlaybook (
playbook: '${book}',
limit: '10.22.8.33,10.22.32.2',
)
}
}
}
}
效果如下