mountpartition.yml 1.52 KB
---
- hosts: 03_vdc-disk
  become: true
  tasks:
        - name: "Mount up \"{{ item.device }}\" to \"{{ item.path }}\""
          mount:
                state: mounted
                fstype: ext4
                src: "{{ item.device }}"
                path: "{{ item.path }}"
          with_items:
                - { device: /dev/vdc1, path: /opt }
                - { device: /dev/vdc2, path: /upload }
                - { device: /dev/vdc3, path: /archive }
                - { device: /dev/vdc4, path: /data }
- hosts: 03_sdb-disk
  become: true
  tasks:
        - name: "Mount up \"{{ item.device }}\" to \"{{ item.path }}\""
          mount:
                state: mounted
                fstype: ext4
                src: "{{ item.device }}"
                path: "{{ item.path }}"
          with_items:
                - { device: /dev/sdb1, path: /opt }
                - { device: /dev/sdb2, path: /upload }
                - { device: /dev/sdb3, path: /archive }
                - { device: /dev/sdb4, path: /data }
                
- hosts: 03_vdb-disk
  become: true
  tasks:
        - name: "Mount up \"{{ item.device }}\" to \"{{ item.path }}\""
          mount:
                state: mounted
                fstype: ext4
                src: "{{ item.device }}"
                path: "{{ item.path }}"
          with_items:
                - { device: /dev/vdb1, path: /opt }
                - { device: /dev/vdb2, path: /upload }
                - { device: /dev/vdb3, path: /archive }
                - { device: /dev/vdb4, path: /data }