deploy_iconsole_script.yml 1.51 KB
---
- hosts: 06_deployed-iConsole-two-host
  become: true
  tasks:
    - name: Copy iConsole
      command: cp /tmp/source/iConsole.tar.gz /opt/stack/iConsole.tar.gz
    - name: Extract root
      command: tar -zxvf /opt/stack/iConsole.tar.gz -C /opt/
    - name: Delete File
      command: rm /opt/stack/iConsole.tar.gz
    - name: Setup Schedule
      command: /opt/Schedule/add_schedule

- hosts: 06_deploy-iConsole-single-host
  become: true
  tasks:
    - name: Copy iConsole
      command: cp /tmp/source/iConsole.singlehost.dma.tar.gz /opt/stack/iConsole.singlehost.dma.tar.gz
    - name: Extract root
      command: tar -zxvf /opt/stack/iConsole.singlehost.dma.tar.gz -C /opt/
    - name: Delete File
      command: rm /opt/stack/iConsole.singlehost.dma.tar.gz
    - name: Setup Schedule
      command: /opt/Schedule/add_schedule

- hosts: 06_deploy-iConsole-single-host-3.0.6.0
  become: true
  tasks:
    - name: Unarchive a file that is already on the remote machine
      unarchive:
        src: /tmp/source/iConsole.singlehost.dma.3.0.6.0.zip
        dest: /opt
        remote_src: yes
        group: wdadmin
        owner: wdadmin
        mode: 0755
    - file:
        path: '/opt/{{ item.dir }}' 
        group: wdadmin
        owner: wdadmin
        mode: 0755
        state: directory
        recurse: yes
      with_items:
            - { dir: 'Accessor' }
            - { dir: 'iConsole' }
            - { dir: 'json' }
            - { dir: 'Schedule' }
    - name: Setup Schedule
      command: /opt/Schedule/add_schedule