---
  - name: create folder "{{ base_dir }}/linux/Appserveradmin"
    file:
      path: "{{ base_dir }}/linux/Appserveradmin"
      state: directory
      mode: '0755'
      owner: jetty
      group: dba
    tags: appserveradmin
      
  - name: unarchive /sw/AMS/WEB/0019_14.1.6.0_Hotfix_BW/linux/Appserver.tar.gz
    unarchive:
      src: /sw/AMS/WEB/0019_14.1.6.0_Hotfix_BW/linux/Appserver.tar.gz
      dest: "{{ base_dir }}/linux/Appserveradmin/"
      remote_src: yes
      owner: jetty
      group: dba  
    tags: appserveradmin
    
  - name: copy common.xml to "{{ base_dir }}/linux/Appserveradmin/config"
    copy:
      src: common.xml
      dest: "{{ base_dir }}/linux/Appserveradmin/config/common.xml"
      owner: jetty
      group: dba
      mode: '0644'
    tags: appserveradmin
    
  - name: Create a file /opt/logs/appserveradmin/rsWebserviceAppserver-servicewrapper.log if it does not exist
    file:          
      path: /opt/logs/appserveradmin/rsWebserviceAppserver-servicewrapper.log
      state: touch
      mode: '0644'
      owner: jetty
      group: dba
    tags: appserveradmin  
      
  - name: Template file pwdAppserver.xml.j2 with owner and permissions 
    template:
      src: pwd_Appserver.xml.j2
      dest: "{{ base_dir }}/linux/Appserveradmin/config/pwd.xml"
      owner: jetty
      group: dba
      mode: '0644'
    tags: appserveradmin  
      
  - name: Template file rsWebserviceAppserver.xml.j2 with owner and permissions 
    template:
      src: rsWebserviceAppserver.xml.j2
      dest: "{{ base_dir }}/linux/Appserveradmin/config/rsWebserviceAppserver.xml"
      owner: jetty
      group: dba
      mode: '0644'
    tags: appserveradmin  
      
  - name: Template file rsWebserviceAppserver.conf.j2 to "{{ base_dir }}/linux/Appserveradmin/service/config/rsWebserviceAppserver.conf"
    template:
      src: rsWebserviceAppserver.conf.j2
      dest: "{{ base_dir }}/linux/Appserveradmin/service/config/rsWebserviceAppserver.conf"
      owner: jetty
      group: dba
      mode: '0644'  
    tags: appserveradmin
      
  - name: Template file jetty.xml.j2 for Appserveradmin with owner and permissions 
    template:
      src: jetty.xml.j2
      dest: "{{ base_dir }}/linux/Appserveradmin/frameworkconfig/jetty_home/etc/jetty.xml"
      owner: jetty 
      group: dba
      mode: '0644'
    tags: appserveradmin
      
  - name: Copy file psc.sh for Appserveradmin with owner and permissions 
    copy:
      src: ./files/psc.sh
      dest: /home/jetty/psc.sh
      owner: jetty 
      group: dba
      mode: '0755'
      
  - name: Copy file startadmin for Appserveradmin with owner and permissions 
    copy:
      src: ./files/startadmin
      dest: /home/jetty/startadmin
      owner: jetty 
      group: dba
      mode: '0755'
      
  - name: Copy file startALL for Appserveradmin with owner and permissions 
    copy:
      src: ./files/startALL
      dest: /home/jetty/startALL
      owner: jetty 
      group: dba
      mode: '0755'
      
  - name: Copy file startALLwoa for Appserveradmin with owner and permissions 
    copy:
      src: ./files/startALLwoa
      dest: /home/jetty/startALLwoa
      owner: jetty 
      group: dba
      mode: '0755'
      
  - name: Copy file startapps for Appserveradmin with owner and permissions 
    copy:
      src: ./files/startapps
      dest: /home/jetty/startapps
      owner: jetty 
      group: dba
      mode: '0755'
      
  - name: Copy file stopadmin for Appserveradmin with owner and permissions 
    copy:
      src: ./files/stopadmin
      dest: /home/jetty/stopadmin
      owner: jetty 
      group: dba
      mode: '0755'
      
  - name: Copy file stopALL for Appserveradmin with owner and permissions 
    copy:
      src: ./files/stopALL
      dest: /home/jetty/stopALL
      owner: jetty 
      group: dba
      mode: '0755'
      
  - name: Copy file stopALLwoa for Appserveradmin with owner and permissions 
    copy:
      src: ./files/stopALLwoa
      dest: /home/jetty/stopALLwoa
      owner: jetty 
      group: dba
      mode: '0755'
      
  - name: Copy file stopapps for Appserveradmin with owner and permissions 
    copy:
      src: ./files/stopapps
      dest: /home/jetty/stopapps
      owner: jetty 
      group: dba
      mode: '0755'
      
  - name: commit changes to git
    shell: |
      git add .
      git -c user.name='Ansible Playbook' -c user.email='ansible@playbook' commit -m "ams_0019_14.1.6.0_AdminServer"
      exit 0
    args:
      chdir: "/opt/rola"















