mirror of https://github.com/ansible/ansible.git
Updates for the unarchive module and action_plugin.
There is a bit going on with the changes here. Most of the changes are cleanup of files so that they line up with the standard files. PR #5136 was merged into the current devel and brought up to working order. A few bug fixes had to be done to get the code to test correctly. Thanks out to @pib! Issue #5431 was not able to be confirmed as it behaved as expected with a sudo user. Tests were added via a playbook with archive files to verify functionality. All tests fire clean including custom playbooks across multiple linux and solaris systems.pull/5969/head
parent
e6c9705058
commit
cb7c2b7524
@ -0,0 +1,78 @@
|
|||||||
|
---
|
||||||
|
# To run me manually, use: -i "localhost,"
|
||||||
|
- hosts: localhost
|
||||||
|
connection: local
|
||||||
|
gather_facts: no
|
||||||
|
vars:
|
||||||
|
- testdir: /tmp/ansible-unarchive
|
||||||
|
- filesdir: test_unarchive/files
|
||||||
|
tasks:
|
||||||
|
|
||||||
|
- name: "Simple tar unarchive."
|
||||||
|
command: rm -rf {{testdir}}
|
||||||
|
- file: state=directory dest={{testdir}}
|
||||||
|
- unarchive: src={{filesdir}}/test.tar dest={{testdir}}
|
||||||
|
register: res
|
||||||
|
- command: test -f {{testdir}}/foo
|
||||||
|
- command: test "{{res.changed}}" = "True"
|
||||||
|
- unarchive: src={{filesdir}}/test.tar dest={{testdir}}
|
||||||
|
register: res
|
||||||
|
- command: test "{{res.changed}}" = "False"
|
||||||
|
|
||||||
|
- name: "Simple tar.gz unarchive."
|
||||||
|
command: rm -rf {{testdir}}
|
||||||
|
- file: state=directory dest={{testdir}}
|
||||||
|
- unarchive: src={{filesdir}}/test.tar.gz dest={{testdir}}
|
||||||
|
register: res
|
||||||
|
- command: test -f {{testdir}}/foo
|
||||||
|
- command: test "{{res.changed}}" = "True"
|
||||||
|
- unarchive: src={{filesdir}}/test.tar.gz dest={{testdir}}
|
||||||
|
register: res
|
||||||
|
- command: test "{{res.changed}}" = "False"
|
||||||
|
|
||||||
|
- name: "Simple zip unarchive."
|
||||||
|
command: rm -rf {{testdir}}
|
||||||
|
- file: state=directory dest={{testdir}}
|
||||||
|
- unarchive: src={{filesdir}}/test.zip dest={{testdir}}
|
||||||
|
register: res
|
||||||
|
- command: test -f {{testdir}}/foo
|
||||||
|
- command: test "{{res.changed}}" = "True"
|
||||||
|
- unarchive: src={{filesdir}}/test.zip dest={{testdir}}
|
||||||
|
register: res
|
||||||
|
- command: test "{{res.changed}}" = "True"
|
||||||
|
|
||||||
|
- name: "Unarchive a local tar file."
|
||||||
|
command : rm -rf {{testdir}}
|
||||||
|
- file: state=directory dest={{testdir}}
|
||||||
|
- copy: src={{filesdir}}/test.tar dest={{testdir}}
|
||||||
|
- unarchive: src={{testdir}}/test.tar dest={{testdir}}
|
||||||
|
register: res
|
||||||
|
- command: test -f {{testdir}}/foo
|
||||||
|
- command: test "{{res.changed}}" = "True"
|
||||||
|
- unarchive: src={{testdir}}/test.tar dest={{testdir}}
|
||||||
|
register: res
|
||||||
|
- command: test "{{res.changed}}" = "False"
|
||||||
|
|
||||||
|
- name: "Unarchive a local tar.gz file."
|
||||||
|
command : rm -rf {{testdir}}
|
||||||
|
- file: state=directory dest={{testdir}}
|
||||||
|
- copy: src={{filesdir}}/test.tar.gz dest={{testdir}}
|
||||||
|
- unarchive: src={{testdir}}/test.tar.gz dest={{testdir}}
|
||||||
|
register: res
|
||||||
|
- command: test -f {{testdir}}/foo
|
||||||
|
- command: test "{{res.changed}}" = "True"
|
||||||
|
- unarchive: src={{testdir}}/test.tar.gz dest={{testdir}}
|
||||||
|
register: res
|
||||||
|
- command: test "{{res.changed}}" = "False"
|
||||||
|
|
||||||
|
- name: "Unarchive a local zip file."
|
||||||
|
command : rm -rf {{testdir}}
|
||||||
|
- file: state=directory dest={{testdir}}
|
||||||
|
- copy: src={{filesdir}}/test.zip dest={{testdir}}
|
||||||
|
- unarchive: src={{testdir}}/test.zip dest={{testdir}}
|
||||||
|
register: res
|
||||||
|
- command: test -f {{testdir}}/foo
|
||||||
|
- command: test "{{res.changed}}" = "True"
|
||||||
|
- unarchive: src={{testdir}}/test.zip dest={{testdir}}
|
||||||
|
register: res
|
||||||
|
- command: test "{{res.changed}}" = "True"
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue