unarchive module supports creates parameter:

creates: 
>    
>    
> a filename, when it already exists, this step will *not* be run. (added 
> in Ansible 1.6)


Edgars

otrdiena, 2015. gada 14. aprīlis 13:16:03 UTC+2, Chris Brooks rakstīja:
>
> Hiya,
>
> I've had a google for this but I can't find anything which answer my 
> question...
>
> I have a playbook which deploys tomcat via a zip file, this is the 
> standard tomcat file from their website.
>
> it then takes a template of server.xml and places it in the 
> /opt/tomcat/conf directory.
>
> This action changes the contents so the next time my playbook runs it 
> re-runs the play which I don't want, is there an easy way around this?
>
> This is the relevant section:-
>
>
> ########################################################################################
>
>
>   - name: Add tomcat group
>     group: name=tomcat state=present
>
>   - name: Add tomcat user
>     user: name=tomcat group=tomcat state=present
>
>   - name: copy the jdk to the local machine
>     copy: src=files/jdk-8u40-linux-x64.rpm dest=/tmp/jdk-8u40-linux-x64.rpm
>
>   - name: install the JDK from a local file
>     yum: name=/tmp/jdk-8u40-linux-x64.rpm state=present
>
>   - name: unpack tomcat
>     unarchive: src=files/apache-tomcat-8.0.20.tar.gz dest=/opt/
>
>   - name: symlink /opt/tomcat to apache tomcat
>     file: src=/opt/apache-tomcat-8.0.20 path=/opt/tomcat state=link 
> force=yes
>
>   - name: generate the server.xml from the template
>     template: src=tomcat/templates/server.xml.j2 
> dest=/opt/tomcat/conf/server.xml mode=755
>
>   - name: install the init.d script for tomcat
>     template: src=tomcat/templates/tomcat.initd.j2 dest=/etc/init.d/tomcat 
> mode=755
>
>   - name: make sure it is all owned by tomcat
>     file: path=/opt/apache-tomcat-8.0.20 owner=tomcat group=tomcat 
> state=directory recurse=yes
>
>
> ########################################################################################
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/aa06043a-d5e0-4868-a117-69dbbf7ebffa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to