try again........
This commit is contained in:
parent
bc29bb8043
commit
745ce0dfab
|
@ -18,56 +18,60 @@ pipeline {
|
||||||
stage("Push out new nrpe configurations") {
|
stage("Push out new nrpe configurations") {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
//withCredentials([sshUserPrivateKey(credentialsId: 'jenkins', keyFileVariable: 'identity', passphraseVariable: '', usernameVariable: 'userName')]) {
|
withCredentials([sshUserPrivateKey(credentialsId: 'jenkins', keyFileVariable: 'identity', passphraseVariable: '', usernameVariable: 'userName')]) {
|
||||||
def remote = [:]
|
def remote = [:]
|
||||||
remote.pi501 = [:]
|
remote.name = "pi501.in.thelinuxpro.net"
|
||||||
remote.pi502 = [:]
|
remote.host = "pi501.in.thelinuxpro.net"
|
||||||
remote.pi503 = [:]
|
remote.allowAnyHosts = true
|
||||||
remote.pi504 = [:]
|
remote.user = userName
|
||||||
|
remote.identityFile = identity
|
||||||
|
|
||||||
remote.pi501.name = "pi501.in.thelinuxpro.net"
|
sshPut remote: remote, from: 'nrpe', into: '/tmp'
|
||||||
remote.pi502.name = "pi502.in.thelinuxpro.net"
|
sshCommand remote: remote, command: 'cd /tmp/nrpe/; chmod +x setup.sh; sudo ./setup.sh'
|
||||||
remote.pi503.name = "pi503.in.thelinuxpro.net"
|
sshRemove remote: remote, path: '/tmp/nrpe'
|
||||||
remote.pi504.name = "pi504.in.thelinuxpro.net"
|
}
|
||||||
|
}
|
||||||
|
script {
|
||||||
|
withCredentials([sshUserPrivateKey(credentialsId: 'jenkins', keyFileVariable: 'identity', passphraseVariable: '', usernameVariable: 'userName')]) {
|
||||||
|
def remote = [:]
|
||||||
|
remote.name = "pi502.in.thelinuxpro.net"
|
||||||
|
remote.host = "pi502.in.thelinuxpro.net"
|
||||||
|
remote.allowAnyHosts = true
|
||||||
|
remote.user = userName
|
||||||
|
remote.identityFile = identity
|
||||||
|
|
||||||
remote.pi501.host = "pi501.in.thelinuxpro.net"
|
sshPut remote: remote, from: 'nrpe', into: '/tmp'
|
||||||
remote.pi502.host = "pi502.in.thelinuxpro.net"
|
sshCommand remote: remote, command: 'cd /tmp/nrpe/; chmod +x setup.sh; sudo ./setup.sh'
|
||||||
remote.pi503.host = "pi503.in.thelinuxpro.net"
|
sshRemove remote: remote, path: '/tmp/nrpe'
|
||||||
remote.pi504.host = "pi504.in.thelinuxpro.net"
|
}
|
||||||
|
}
|
||||||
|
script {
|
||||||
|
withCredentials([sshUserPrivateKey(credentialsId: 'jenkins', keyFileVariable: 'identity', passphraseVariable: '', usernameVariable: 'userName')]) {
|
||||||
|
def remote = [:]
|
||||||
|
remote.name = "pi503.in.thelinuxpro.net"
|
||||||
|
remote.host = "pi503.in.thelinuxpro.net"
|
||||||
|
remote.allowAnyHosts = true
|
||||||
|
remote.user = userName
|
||||||
|
remote.identityFile = identity
|
||||||
|
|
||||||
remote.pi501.allowAnyHosts = true
|
sshPut remote: remote, from: 'nrpe', into: '/tmp'
|
||||||
remote.pi502.allowAnyHosts = true
|
sshCommand remote: remote, command: 'cd /tmp/nrpe/; chmod +x setup.sh; sudo ./setup.sh'
|
||||||
remote.pi503.allowAnyHosts = true
|
sshRemove remote: remote, path: '/tmp/nrpe'
|
||||||
remote.pi504.allowAnyHosts = true
|
}
|
||||||
|
}
|
||||||
|
script {
|
||||||
|
withCredentials([sshUserPrivateKey(credentialsId: 'jenkins', keyFileVariable: 'identity', passphraseVariable: '', usernameVariable: 'userName')]) {
|
||||||
|
def remote = [:]
|
||||||
|
remote.name = "pi504.in.thelinuxpro.net"
|
||||||
|
remote.host = "pi504.in.thelinuxpro.net"
|
||||||
|
remote.allowAnyHosts = true
|
||||||
|
remote.user = userName
|
||||||
|
remote.identityFile = identity
|
||||||
|
|
||||||
def userName = 'jenkins'
|
sshPut remote: remote, from: 'nrpe', into: '/tmp'
|
||||||
remote.pi501.user = userName
|
sshCommand remote: remote, command: 'cd /tmp/nrpe/; chmod +x setup.sh; sudo ./setup.sh'
|
||||||
remote.pi502.user = userName
|
sshRemove remote: remote, path: '/tmp/nrpe'
|
||||||
remote.pi503.user = userName
|
}
|
||||||
remote.pi504.user = userName
|
|
||||||
|
|
||||||
def identity = '/home/jenkins/.ssh/jenkins_id_ed25519'
|
|
||||||
remote.pi501.identityFile = identity
|
|
||||||
remote.pi502.identityFile = identity
|
|
||||||
remote.pi503.identityFile = identity
|
|
||||||
remote.pi504.identityFile = identity
|
|
||||||
|
|
||||||
sshPut remote: remote.pi501, from: 'nrpe', into: '/tmp'
|
|
||||||
sshCommand remote: remote.pi501, command: 'cd /tmp/nrpe/; chmod +x setup.sh; sudo ./setup.sh'
|
|
||||||
sshRemove remote: pi501, path: '/tmp/nrpe'
|
|
||||||
|
|
||||||
sshPut remote: remote.pi502, from: 'nrpe', into: '/tmp'
|
|
||||||
sshCommand remote: remote.pi502, command: 'cd /tmp/nrpe/; chmod +x setup.sh; sudo ./setup.sh'
|
|
||||||
sshRemove remote: pi502, path: '/tmp/nrpe'
|
|
||||||
|
|
||||||
sshPut remote: remote.pi503, from: 'nrpe', into: '/tmp'
|
|
||||||
sshCommand remote: remote.pi503, command: 'cd /tmp/nrpe/; chmod +x setup.sh; sudo ./setup.sh'
|
|
||||||
sshRemove remote: pi503, path: '/tmp/nrpe'
|
|
||||||
|
|
||||||
sshPut remote: remote.pi504, from: 'nrpe', into: '/tmp'
|
|
||||||
sshCommand remote: remote.pi504, command: 'cd /tmp/nrpe/; chmod +x setup.sh; sudo ./setup.sh'
|
|
||||||
sshRemove remote: pi504, path: '/tmp/nrpe'
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue