From 2320b24011e40dc23a6f1533cd13d4bd7255d2af Mon Sep 17 00:00:00 2001 From: jonnybravo Date: Mon, 5 Jun 2023 19:31:06 +0200 Subject: [PATCH] added Jenkinsfile --- Jenkinsfile | 9 ++++++++- test_play.yml | 6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index dfa425a..ea1df43 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,13 +16,20 @@ pipeline { } } - stage('Ansible') { + stage('Ansible local run') { agent any steps { ansiblePlaybook playbook: 'local_test.yml' // ansiblePlaybook credentialsId: '209d0fa2-bbd7-4af5-9aac-deec1b6aa7ec', inventory: '192.168.150.40,', playbook: 'test_play.yml' } } + stage('Ansible Remote') { + agent any + steps { + ansiblePlaybook credentialsId: '209d0fa2-bbd7-4af5-9aac-deec1b6aa7ec', inventory: '192.168.50.40,', playbook: 'test_play.yml' + } + } + } } diff --git a/test_play.yml b/test_play.yml index e17862e..0feb2cf 100755 --- a/test_play.yml +++ b/test_play.yml @@ -3,9 +3,9 @@ - name: "TestPlay" gather_facts: true become: false - #hosts: 192.168.150.40 - hosts: localhost - connection: local + hosts: 192.168.50.40 + #hosts: localhost + #connection: local tasks: - debug: msg: "Hello World"