From 6ad3cc11d64ac4032bc00e7725dab114710b79f4 Mon Sep 17 00:00:00 2001 From: jonnybravo Date: Mon, 5 Jun 2023 14:50:19 +0200 Subject: [PATCH] added Jenkinsfile --- Jenkinsfile | 2 +- local_test.yml | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100755 local_test.yml diff --git a/Jenkinsfile b/Jenkinsfile index c154b9e..dfa425a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,7 +19,7 @@ pipeline { stage('Ansible') { agent any 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' } } diff --git a/local_test.yml b/local_test.yml new file mode 100755 index 0000000..d48bdfa --- /dev/null +++ b/local_test.yml @@ -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') }}'"