Is there a nicer way of doing zcat
in ansible than invoking shell
?
- name: "Unpack the local config"
shell: "zcat /proc/config.gz > /usr/src/linux/.config"
args:
creates: "/usr/src/linux/.config"
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.
Sign up to join this communityIn the future there might be an uncompress
module, but today no:
https://github.com/ansible/ansible-modules-core/issues/3241#issuecomment-240991265
The unarchive module only supports archives, not compressed files. The documentation was improved to make that more clear. We anticipate a new pure-python uncompress module that will support compressed files as well as archives, which would then deprecate the unarchive module.
unarchive
withremote_src: yes
. I don't have access to test just now.