Skip to content

Commit

Permalink
Simplify the mkdir
Browse files Browse the repository at this point in the history
  • Loading branch information
Ladas committed Jul 17, 2018
1 parent ea444a2 commit 49e9d29
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/ansible/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def run(env_vars, extra_vars, playbook_path)

def run_via_cli(env_vars, extra_vars, playbook_path)
Dir.mktmpdir("ansible-runner") do |base_dir|
mkdir(base_dir + '/project') # without this, there is a silent fail of the ansible-runner command see https://github.com/ansible/ansible-runner/issues/88
Dir.mkdir(File.join(base_dir, 'project')) # without this, there is a silent fail of the ansible-runner command see https://github.com/ansible/ansible-runner/issues/88

result = AwesomeSpawn.run!(ansible_command(base_dir), :env => env_vars, :params => [{:cmdline => "--extra-vars '#{JSON.dump(extra_vars)}'", :playbook => playbook_path}])

Expand All @@ -21,10 +21,6 @@ def return_code(base_dir)
File.read(File.join(base_dir, "artifacts/result/rc"))
end

def mkdir(base_dir)
Dir.mkdir(base_dir) unless Dir.exist?(base_dir)
end

def ansible_command(base_dir)
# TODO add possibility to use custom path, e.g. from virtualenv
"ansible-runner run #{base_dir} --json -i result"
Expand Down

0 comments on commit 49e9d29

Please sign in to comment.