The below playbook will log into tomcat server Create a folder called Downloads. Download artifact into it and copy them into the /var/lib/tomcat8/webapps
DevOps Training Program that will provide you with in-depth knowledge of various DevOps tools including Git, Jenkins, Docker, Ansible, Puppet, Kubernetes and Nagios. This training is completely hands-on and designed in a way to help you become a certified practitioner through best practices in Continuous Development, Continuous Testing, Configuration Management and Continuous Integration, and finally, Continuous Monitoring of software throughout its development life cycle.
Saturday, 20 February 2021
Deploying with Ansible Tower( Playbook to deploy artifact to tomcat)
Playbook 4
---
- name: Playbook to Download and Deploy Artifact in tomcat
  hosts: "{{ deploy_host }}"    
  tasks:
  - name: Create a Directory /opt/Downloads
    become: yes
    file:
      path: /opt/Downloads
      state: directory
      mode: 0755
      owner: tomcat8
      group: tomcat8
  - name: Download Artifact from Artifactory
    become: yes
    get_url:
      url: https://urloftheartifac
      url_password: Sarav@123
      url_username: sarav
      dest: /opt/Downloads/MyWebApp.war
      mode: 0755
      group: tomcat8
      owner: tomcat8
  - name: Copy File to webapp folder
    become: yes
    copy:
      src: /opt/Downloads/MyWebApp.war
      dest: /var/lib/tomcat8/webapps
      remote_src: yes
      mode: 0755
      owner: tomcat8
      group: tomcat8
  - name: Delete a Directory /opt/Downloads
    become: yes
    file:
      path: /opt/Downloads
      state: absent
Subscribe to:
Post Comments (Atom)
How to upgrade Maven
java.lang.IllegalStateException I had installed maven in my ubuntu using command apt install maven This installed maven in path /usr/shar...
- 
SQL Fundamentals Course SQL Fundamentals Course Documentation Table of Contents ...
- 
ONLY 10 SLOTS AVAILABLE!!!!! 🎉✨ **Limited Time Offer: Supercharge Your DevOps Skills for Less!** ✨🎉 Are you ready to level up your DevO...
- 
java.lang.IllegalStateException I had installed maven in my ubuntu using command apt install maven This installed maven in path /usr/shar...
 
 
No comments:
Post a Comment