If copyno, path on the target server to existing archive file to unpack. states: -If copyyes (default), local path to archive file to copy to the target server can be absolute or relative. If you need to run all scripts sequentially, then use xargs to run them each as separate commands. 1 Answer Sorted by: 12 It seems like copy parameter for unarchive module is what tripped you up. WARNING: Because all environments live on a single host, all playbooks must be run individually, otherwise Ansible will brokenly attempt to run all scripts as the first ssh login user and only use the variables for the first user. name: extract foo.zip to /tmp unarchive: src: foo. Then, src would just be the name of the file that is being unarchived. This is the main logic for a directory tree of optional variable files. If using the unarchive module in a role (see Ansible - Getting Started with Roles), the file being unarchived can be placed in the roles files directory. Hash_behaviour=merge merge rather than replace dictionaries note that this does shallow hash merging (1 level deep) and not fully recursive deep merge ansible.cfg Start by enabling variable merging in ansible This required a directory tree of (optional) variable.yml files, that would merge ontop of each other and not throw an exception if any where missing In the future, sometimes starting a discussion on the development list prior to proposing or implementing a feature can make getting things included a little easier, but it's not always necessary.I encountered this problem in a setup where I needed to create multiple deployment environments (live, demo, sandbox) to the same physical server (not allowed virtual machines here), and then a script to deploy arbitrary svn repos If you or anyone else has any further questions, please let us know by using any of the communication methods listed in the page below: Because this project is very active, we're unlikely to see comments made on closed tickets and we lock them after some time. However, we're absolutely always up for discussion. So we are going to close this issue to clear up the queues and make it easier for contributors to browse possible implementation targets. Unfortunately, this issue has been open for some time while waiting for a contributor to take it up but there does not seem to have been anyone that did so. It means a lot to us that you've taken time to contribute. Here are some essential points of Ansible unarchive, such as: It requires zipinfo and gtar/unzip command on the target remote host. Thank you very much for your submission to Ansible. Url: dest: ' ' state: absent changed_when: False when: font_files_stat.results | rejectattr('stat.exists') | list name: Dowload the Source Code Pro font archive to the temporary directory get_url: State: directory changed_when: False register: font_dowload_tempdir name: Create a temporary directory to dowlnoad Source Code Pro to tempfile: name: Install the Source Code Pro font block: ~/.local/share/fonts/SourceCodePro-Semibold.otf changed_when: False register: font_files_stat # Sadly there's no way to have a whitelist with the unarchive module, so we must use the unzip # command directly, see ~/.local/share/fonts/SourceCodePro-SemiboldIt.otf ~/.local/share/fonts/SourceCodePro-Regular.otf Please note that it requires a tarball (. It requires zipinfo, gtar and unzip command on target host. ~/.local/share/fonts/SourceCodePro-Medium.otf It unpacks one archive after (optionally) copying it from the local machine It can handle. ~/.local/share/fonts/SourceCodePro-MediumIt.otf ~/.local/share/fonts/SourceCodePro-Light.otf For ansible I've tried: unarchive: remotesrc: yes src: /ingres/ingres.tar dest: /ingres extraopts: - 'install'. In Linux OS for install directory unpacking - I simply do: tar -xvf ingres.tar install. ~/.local/share/fonts/SourceCodePro-LightIt.otf I'd like to extract one directory from tar file. ~/.local/share/fonts/SourceCodePro-It.otf ~/.local/share/fonts/SourceCodePro-ExtraLight.otf ~/.local/share/fonts/SourceCodePro-ExtraLightIt.otf ~/.local/share/fonts/SourceCodePro-Bold.otf ~/.local/share/fonts/SourceCodePro-BoldIt.otf ~/.local/share/fonts/SourceCodePro-Black.otf ~/.local/share/fonts/SourceCodePro-BlackIt.otf name: Check whether the files exist stat: # Currently there's no way to check that a shell command creates multiple files, # see hosts: localhost connection: local tasks:
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |