successful windows ansible run fixed
This commit is contained in:
@ -21,27 +21,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
|
|
||||||
stage('Powershell Test'){
|
|
||||||
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
def remoteHost = '${params.host_ip}'
|
|
||||||
def powershellScript = '''
|
|
||||||
$username = "${env:ansible_service_windows_USR}"
|
|
||||||
$password = "${env:ansible_service_windows_PSW}"
|
|
||||||
Write-Host "Using username: $username and password: $password"
|
|
||||||
'''
|
|
||||||
|
|
||||||
bat """
|
|
||||||
echo Running PowerShell script on remote machine...
|
|
||||||
cmd /c powershell -Command "& { ${powershellScript} }"
|
|
||||||
"""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Generate Inventory File') {
|
stage('Generate Inventory File') {
|
||||||
steps {
|
steps {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user