forked from Brights-DevOps-2022-Script/Hello-World_Ulrike
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
30 lines (29 loc) · 1.01 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
pipeline {
agent {
docker {
image 'cytopia/ansible'
args '-u root:root'
}
}
environment {
ANSIBLE_KEY = credentials('vm_frosty') // legt 2 Variablen an: //ANSIBLE_KEY_USR und //ANSIBLE_KEY_PSW, den habe ich in ansible angelegt, bei credentials, hier ID eingeben
ANSIBLE_HOST_KEY_CHECKING = 'False' //damit der die Certificates nicht checkt und kein ERR "unreachable" ausgeworfen wird
}
stages {
stage('Jenkins install') {
steps {
sh 'apk update'
sh 'apk add --update --no-cache openssh sshpass'
sh 'ansible --version'
// sh "ansible-playbook --version"
// sh "ansible-playbook -i hostfile playbook_Jenkins.yml -e ansible_ssh_pass=$ANSIBLE_KEY_PSW"
}
}
stage('deploy') {
steps {
sh 'echo We did it!.'
sh 'echo We are awesome!'
}
}
}
}