---
#ams
  - name: create folder /opt/rola/ams
    file:
      path: /opt/rola/ams
      state: directory
      mode: '0755'
      owner: jetty
      group: dba

  - name: create folder /opt/rola/ams/linux
    file:
      path: /opt/rola/ams/linux
      state: directory
      mode: '0755'
      owner: jetty
      group: dba
      
  - name: create folder /opt/rola/ams/linux/Appserver
    file:
      path: /opt/rola/ams/linux/Appserver
      state: directory
      mode: '0755'
      owner: jetty
      group: dba
      
  - name: create folder /opt/rola/ams/linux/Services
    file:
      path: /opt/rola/ams/linux/Services
      state: directory
      mode: '0755'
      owner: jetty
      group: dba
      
  - name: unarchive /sw/AMS/WEB/0016_14.1.2.0_AMS/1202153903_RS-97187_0016_14.1.2.0_AMS_1_6_BW_mit_Migration/linux/Appserver.tar.gz
    unarchive:
      src: /sw/AMS/WEB/0016_14.1.2.0_AMS/1202153903_RS-97187_0016_14.1.2.0_AMS_1_6_BW_mit_Migration/linux/Appserver.tar.gz
      dest: /opt/rola/ams/linux/Appserver/
      remote_src: yes
      owner: jetty
      group: dba  
      
  - name: unarchive /sw/AMS/WEB/0016_14.1.2.0_AMS/1202153903_RS-97187_0016_14.1.2.0_AMS_1_6_BW_mit_Migration/linux/Services.tar.gz
    unarchive:
      src: /sw/AMS/WEB/0016_14.1.2.0_AMS/1202153903_RS-97187_0016_14.1.2.0_AMS_1_6_BW_mit_Migration/linux/Services.tar.gz
      dest: /opt/rola/ams/linux/Services/
      remote_src: yes
      owner: jetty
      group: dba 
      
  - name: create folder webclient-services
    file:
      path: /opt/rola/ams/linux/webclient-services
      state: directory
      mode: '0755'
      owner: jetty
      group: dba
      
  - name: tar datei rsAmsBvService-14.1.2.0.tar.gz entpacken
    unarchive:
      src: /sw/AMS/WEB/0016_14.1.2.0_AMS/1202153903_RS-97187_0016_14.1.2.0_AMS_1_6_BW_mit_Migration/linux/webclient-services/rsAmsBvService-14.1.2.0.tar.gz
      dest: /opt/rola/ams/linux/webclient-services/
      remote_src: yes
      owner: jetty
      group: dba
      
  - name: tar datei SharedComponents-14.1.2.0.tar.gz entpacken
    unarchive:
      src: /sw/AMS/WEB/0016_14.1.2.0_AMS/1202153903_RS-97187_0016_14.1.2.0_AMS_1_6_BW_mit_Migration/linux/webclient-services/SharedComponents-14.1.2.0.tar.gz
      dest: /opt/rola/ams/linux/webclient-services/
      remote_src: yes
      owner: jetty
      group: dba


  - name: Template file pwdAppserver.xml.j2 with owner and permissions 
    template:
      src: pwd_Appserver.xml.j2
      dest: /opt/rola/ams/linux/Appserver/config/pwd.xml
      owner: jetty
      group: dba
      mode: '0644'
  - name: Template file rsWebserviceAppserver.xml.j2 with owner and permissions 
    template:
      src: rsWebserviceAppserver.xml.j2
      dest: /opt/rola/ams/linux/Appserver/config/rsWebserviceAppserver.xml
      owner: jetty
      group: dba
      mode: '0644'
  - name: Template file rsWebserviceAppserver.conf.j2 to /opt/rola/ams/linux/Appserver/service/config/rsWebserviceAppserver.conf
    template:
      src: rsWebserviceAppserver.conf.j2
      dest: /opt/rola/ams/linux/Appserver/service/config/rsWebserviceAppserver.conf
      owner: jetty
      group: dba
      mode: '0644'
  - name: Template file pwd_ServiceIMP.xml.j2 with owner and permissions 
    template:
      src: pwd_ServiceIMP.xml.j2
      dest: /opt/rola/ams/linux/Services/config/pwd.xml
      owner: jetty
      group: dba
      mode: '0644'
  - name: Copy file rsWebserviceImp20.xml.j2 with owner and permissions 
    template:
      src: rsWebserviceImp20.xml.j2
      dest: /opt/rola/ams/linux/Services/config/rsWebserviceImp20.xml
      owner: jetty 
      group: dba
      mode: '0644'
  - name: Template file rsWebserviceImp20.conf.j2 with owner and permissions 
    template:
      src: rsWebserviceImp20.conf.j2
      dest: /opt/rola/ams/linux/Services/service/config/rsWebserviceImp20.conf
      owner: jetty 
      group: dba
      mode: '0644'
  - name: Template file rsAmsBvService.conf.j2 with owner and permissions 
    template:
      src: rsAmsBvService.conf.j2
      dest: /opt/rola/ams/linux/webclient-services/rsAmsBvService-14.1.2.0/service/config/rsAmsBvService.conf
      owner: jetty 
      group: dba
      mode: '0644'
  - name: Template file tech.database.yaml.j2 with owner and permissions 
    template:
      src: tech.database.yaml.j2
      dest: /opt/rola/ams/linux/webclient-services/rsAmsBvService-14.1.2.0/frameworkconfig/prefs/tech.database.yaml
      owner: jetty 
      group: dba
      mode: '0644'
  - name: Template file jetty.xml.j2 for Appserver with owner and permissions 
    template:
      src: jetty.xml.j2
      dest: /opt/rola/ams/linux/Appserver/frameworkconfig/jetty_home/etc/jetty.xml
      owner: jetty 
      group: dba
      mode: '0644'
  - name: Template file jetty.xml.j2 for Services with owner and permissions 
    template:
      src: jetty.xml.j2
      dest: /opt/rola/ams/linux/Services/frameworkconfig/jetty_home/etc/jetty.xml
      owner: jetty 
      group: dba
      mode: '0644'
      
  - name: copy common.xml to /opt/rola/ams/linux/Appserver/config
    copy:
      src: common.xml
      dest: /opt/rola/ams/linux/Appserver/config/common.xml
      owner: jetty
      group: dba
      mode: '0644'
      
  - name: copy common.xml to /opt/rola/ams/linux/Services/config
    copy:
      src: common.xml
      dest: /opt/rola/ams/linux/Services/config/common.xml
      owner: jetty
      group: dba
      mode: '0644'
      
# wleche jdk-version muss genutzt werden?
# openjdk alt entfernen und dann neues tar-installieren?
      
      
 
  #- name: commit changes to git
    #shell: |
      #git add .
      #git -c user.name='Ansible Playbook' -c user.email='ansible@playbook' commit -m "ams_0016_14.1.2.0"
      #exit 0
    #args:
      #chdir: "/opt/rola"      
      
      

















