Skip to content

Instantly share code, notes, and snippets.

@base10
Last active December 24, 2015 02:29
Show Gist options
  • Save base10/6731096 to your computer and use it in GitHub Desktop.
Save base10/6731096 to your computer and use it in GitHub Desktop.
Local action directory "fails"
---
- name: gather test results
hosts: '{{ec2_host_group }}'
user: '{{ user }}'
gather_facts: True
vars_files:
- group_vars/all
vars:
results_base_path: /tmp/mysql_slap_results
run_datetime: '{{ lookup("pipe", "date +%Y-%m-%dT%H:%M:%SZ") }}'
pre_tasks:
- name: create results folder
local_action: file
path={{ results_base_path }}/{{ run_datetime }}
state=directory
ignore_errors: yes
roles:
- gather-test-results
GATHERING FACTS ***************************************************************
ok: [redacted1.example.com]
ok: [redacted2.example.com]
TASK: [create results folder] *************************************************
changed: [redacted1.example.com]
failed: [redacted2.example.com] => {"failed": true, "parsed": false}
invalid output was: Traceback (most recent call last):
File "/Users/nathan/.ansible/tmp/ansible-1380298478.27-260287155991478/file", line 1272, in <module>
main()
File "/Users/nathan/.ansible/tmp/ansible-1380298478.27-260287155991478/file", line 247, in main
os.makedirs(path)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 17] File exists: '/tmp/mysql_slap_results/2013-09-27T12:14:38Z'
...ignoring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment