diff --git a/lib/smart_proxy_ansible/runner/ansible_runner.rb b/lib/smart_proxy_ansible/runner/ansible_runner.rb index 074d3d2..8ab9507 100644 --- a/lib/smart_proxy_ansible/runner/ansible_runner.rb +++ b/lib/smart_proxy_ansible/runner/ansible_runner.rb @@ -24,6 +24,7 @@ def initialize(input, suspended_action:, id: nil) @check_mode = action_input[:check_mode] @job_check_mode = action_input[:job_check_mode] @diff_mode = action_input[:diff_mode] + @job_diff_mode = action_input[:job_diff_mode] @tags = action_input[:tags] @tags_flag = action_input[:tags_flag] @passphrase = action_input['secrets']['key_passphrase'] @@ -234,7 +235,11 @@ def check_cmd end def diff_cmd - diff_mode? ? '"--diff"' : '' + if diff_mode? || job_diff_mode? + '"--diff"' + else + '' + end end def verbosity @@ -257,6 +262,10 @@ def diff_mode? @diff_mode == true end + def job_diff_mode? + @job_diff_mode == true + end + def prepare_directory_structure inner = %w[inventory project env].map { |part| File.join(@root, part) } ([@root] + inner).each do |path| diff --git a/test/fixtures/action_input.json b/test/fixtures/action_input.json index 6f4ae6c..8286bd3 100644 --- a/test/fixtures/action_input.json +++ b/test/fixtures/action_input.json @@ -92,6 +92,8 @@ "name": "test-00.example.com", "check_mode": false, "job_check_mode": false, + "diff_mode": false, + "job_diff_mode": false, "hostname": "127.0.0.1", "script": "---\n- hosts: all\n tasks:\n - shell:\n cmd: |\n ls -la /\n register: out\n - debug: var=out", "execution_timeout_interval": null,