Today I used first-time ansible unarchive module and immediately I got error like beginning of everything. Thanks to ansible again that proved that rule.
Error was about that extracting file (tar.gz) which I download with get_url module on remote server in master ansible server.
Definition of problem
While Ansible master was connected to it’s slave, when the step is unarchiving file, master node started to search tar.gz file in my project.
Solution
Hopefully solution was easy after reading manual, just add remote_src: True to YAML block
Example Code block(it works :))
1 2 3 4 5 6 7 8 |
- name: unarchive ant files unarchive: src: /opt/executables/apache-ant-{{ item }}-bin.tar.gz dest: "{{executables_folder}}" remote_src: True copy: no args: chdir: "{{ executables_folder }}" |