44 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Groovy
		
	
	
	
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Groovy
		
	
	
	
	
	
| pipeline {
 | |
|     agent any
 | |
|     tools {
 | |
|         git 'Default'
 | |
|     }
 | |
|     parameters {
 | |
|         booleanParam(name: 'TERRAFORM', defaultValue: false)
 | |
|     }
 | |
|     stages {
 | |
|         stage('Clean workspace') {
 | |
|             steps {
 | |
|                 cleanWs()
 | |
|             }
 | |
|         }
 | |
|         stage('Checkout') {
 | |
|             steps {
 | |
|                 checkout([
 | |
|                     $class: 'GitSCM',
 | |
|                     branches: [[name: 'master']],
 | |
|                     extensions: [],
 | |
|                     userRemoteConfigs: [[credentialsId: 'tools-deploy-key', url: '_gitea@gitea.release11.com:R11/release11-tools.git']]
 | |
|                 ])
 | |
|             }
 | |
|         }
 | |
|         stage('Run Ansible playbook') {
 | |
|             steps {
 | |
|                 sh '''
 | |
|                     pwd
 | |
|                     ls
 | |
|                 '''
 | |
|                 ansiblePlaybook(
 | |
|                     playbook: 'TOOLS.yml',
 | |
|                     inventory: 'inventory/hosts',
 | |
|                     credentialsId: 'tools-deploy-key',
 | |
|                     extraVars: [
 | |
|                         login: 'netadm',
 | |
|                     ])
 | |
|                 )
 | |
|             }
 | |
|         }
 | |
|     }
 | |
| }
 | |
| 
 |