{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/2097","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/2097/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/2097/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/2097/events","html_url":"https://github.com/ansible/ansible/issues/2097","id":11060092,"number":2097,"title":"Module Request: Extract and Archive","user":{"login":"mbadran","id":13339,"avatar_url":"https://avatars.githubusercontent.com/u/13339?v=3","gravatar_id":"","url":"https://api.github.com/users/mbadran","html_url":"https://github.com/mbadran","followers_url":"https://api.github.com/users/mbadran/followers","following_url":"https://api.github.com/users/mbadran/following{/other_user}","gists_url":"https://api.github.com/users/mbadran/gists{/gist_id}","starred_url":"https://api.github.com/users/mbadran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbadran/subscriptions","organizations_url":"https://api.github.com/users/mbadran/orgs","repos_url":"https://api.github.com/users/mbadran/repos","events_url":"https://api.github.com/users/mbadran/events{/privacy}","received_events_url":"https://api.github.com/users/mbadran/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible/labels/feature_idea","name":"feature_idea","color":"006b75"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":40,"created_at":"2013-02-16T01:52:49Z","updated_at":"2016-06-23T09:15:32Z","closed_at":"2013-04-05T20:08:03Z","body":"I have the following Ansible command in several playbooks:\r\n\r\n    - name: quietly unzip the product archive to /opt, overwriting the previous dir\r\n      command: unzip -qo /path/to/product.zip -d /opt\r\n\r\nI also use the tar equivalent:\r\n\r\n    - name: quietly unzip the archive to /opt/product, overwriting the previous dir\r\n      command: tar -zxf /path/to/product.tar.gz -C /opt/product --strip-components 1 --overwrite --overwrite-dir\r\n\r\nThis seems unnecessarily low level to me. Ideally, I would like to use an idempotent \"extract\" module as such:\r\n\r\n    - name: extract the archive\r\n      extract: src=/path/to/product.tar.gz\r\n               dest=/opt/product\r\n               type=tgz\r\n               verbose=yes\r\n               backup=yes\r\n\r\nSupported archive types could include zip, tar, tgz, jar, war -- ie. any format supported by the underlying platform, which would of course depend on the appropriate packages being installed (and perhaps that can be handled by the module as well).\r\n\r\nLikewise, an \"archive\" module that performs the opposite:\r\n\r\n    - name: archive the files\r\n      archive: src=${item}\r\n               dest=/tmp/product.tar.gz\r\n               type=tgz\r\n               verbose=yes\r\n               backup=yes\r\n       with_items:\r\n               - /opt/product1/*.xml\r\n               - /opt/product2/*.txt\r\n               - /opt/product3/*.sh\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/227993870","html_url":"https://github.com/ansible/ansible/issues/2097#issuecomment-227993870","issue_url":"https://api.github.com/repos/ansible/ansible/issues/2097","id":227993870,"user":{"login":"sighalt","id":8299301,"avatar_url":"https://avatars.githubusercontent.com/u/8299301?v=3","gravatar_id":"","url":"https://api.github.com/users/sighalt","html_url":"https://github.com/sighalt","followers_url":"https://api.github.com/users/sighalt/followers","following_url":"https://api.github.com/users/sighalt/following{/other_user}","gists_url":"https://api.github.com/users/sighalt/gists{/gist_id}","starred_url":"https://api.github.com/users/sighalt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sighalt/subscriptions","organizations_url":"https://api.github.com/users/sighalt/orgs","repos_url":"https://api.github.com/users/sighalt/repos","events_url":"https://api.github.com/users/sighalt/events{/privacy}","received_events_url":"https://api.github.com/users/sighalt/received_events","type":"User","site_admin":false},"created_at":"2016-06-23T09:15:32Z","updated_at":"2016-06-23T09:15:32Z","body":"+1"}}
{"actor":{"display_login":"sighalt"}}