added Jenkinsfile
All checks were successful
multibranch_ansible/pipeline/head This commit looks good

This commit is contained in:
2023-06-05 14:50:19 +02:00
parent 5a85a298a1
commit 6ad3cc11d6
2 changed files with 18 additions and 1 deletions

2
Jenkinsfile vendored
View File

@@ -19,7 +19,7 @@ pipeline {
stage('Ansible') { stage('Ansible') {
agent any agent any
steps { steps {
ansiblePlaybook playbook: 'test_play.yml' ansiblePlaybook playbook: 'local_test.yml'
// ansiblePlaybook credentialsId: '209d0fa2-bbd7-4af5-9aac-deec1b6aa7ec', inventory: '192.168.150.40,', playbook: 'test_play.yml' // ansiblePlaybook credentialsId: '209d0fa2-bbd7-4af5-9aac-deec1b6aa7ec', inventory: '192.168.150.40,', playbook: 'test_play.yml'
} }
} }

17
local_test.yml Executable file
View File

@@ -0,0 +1,17 @@
#! /usr/bin/env ansible-playbook
---
- name: "TestPlay"
gather_facts: true
become: false
#hosts: 192.168.150.40
hosts: localhost
connection: local
tasks:
- debug:
msg: "Hello World"
- debug:
var: ansible_host
- debug:
var: playbook_dir
- debug:
msg: "'{{ lookup('ansible.builtin.env', 'test') }}'"