Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion lib/smart_proxy_ansible/runner/ansible_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down Expand Up @@ -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
Expand All @@ -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|
Expand Down
2 changes: 2 additions & 0 deletions test/fixtures/action_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down