Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asterisk sounds directory needs to exist before downloading and extracting Asterisk sounds #17

Open
alvaro-gh opened this issue Sep 11, 2018 · 1 comment

Comments

@alvaro-gh
Copy link
Contributor

I'm using this role with spanish sounds and it fails with the next error:

TASK [install-asterisk : Download and extract Asterisk sounds] ***********
fatal: [default]: FAILED! => {"changed": false, "msg": "dest '/var/lib/asterisk/sounds/es' must be an existing dir"}

It seems that unarchive module (ansible 2.5 doc) does not create destination directory if it doesn't exist. I don't actually remember if Asterisk default sounds directory is /var/lib/asterisk/sounds/en but this path is defined in vars/main.yml and it may be the reason this task has not failed so far.

Anyway, a fix is actually simple, creating the directory before unpacking sounds:

# tasks/install.yml snippet
- name: Create install dir
  file: "path={{ iasterisk_srcdir }} state=directory"

# fix
- name: Create sounds dir
  file: "path={{ iasterisk_path_sound }} state=directory"

- name: Download and extract Asterisk sounds
  unarchive: "src={{ iasterisk_url_sounds }} dest={{ iasterisk_path_sound }} remote_src=yes extra_opts=--strip-components=1"

Please let me know if you want this as a PR.

@dougbtv
Copy link
Owner

dougbtv commented Sep 11, 2018

@mxdlx -- would love the PR! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants