Skip to content

Storage Variables

Tip

All storage roles have the ability to generate host_vars templates when the generate_host_vars tag is used. This allows you to run the playbooks to generate the necessary variables before actually provisioning storage. For example, you can run the following command to generate host variables for all Azure Windows hosts provisioned with managed disks:

ansible-playbook -i inventory.azure_rm.yml --limit='has_attached_disks:&azure_rm_windows' playbooks/storage/provision-azure-windows.yml --tags generate_host_vars

Storage variables are typically defined in host_vars because they are usually specific to individual hosts, however, variables may be defined in group_vars if they apply to a group of hosts. The storage variable structure is different for Windows and Linux. See below for examples.

Windows

volumes:
  cabsql00:
    DriveLetter: S
    FSLabel: Caboodle_SQL
  cabmount00:
    DriveLetter: M
    AllocationUnitSize: 65536
    FSLabel: null
  cabrpt00:
    AccessPath: M:\Caboodle_Report1
    FSLabel: Caboodle_Report1
    AllocationUnitSize: 65536
  cabrpt01:
    AccessPath: M:\Caboodle_Report2
    FSLabel: Caboodle_Report2
    AllocationUnitSize: 65536
  cabrpt02:
    AccessPath: M:\Caboodle_Report3
    FSLabel: Caboodle_Report3
    AllocationUnitSize: 65536
  cabrpt03:
    AccessPath: M:\Caboodle_Report4
    FSLabel: Caboodle_Report4
    AllocationUnitSize: 65536
  cabrpt04:
    AccessPath: M:\Caboodle_Report5
    FSLabel: Caboodle_Report5
    AllocationUnitSize: 65536
  cabrpt05:
    AccessPath: M:\Caboodle_Report6
    FSLabel: Caboodle_Report6
    AllocationUnitSize: 65536
  cabrpt06:
    AccessPath: M:\Caboodle_Report7
    FSLabel: Caboodle_Report7
    AllocationUnitSize: 65536
  cabrpt07:
    AccessPath: M:\Caboodle_Report8
    FSLabel: Caboodle_Report8
    AllocationUnitSize: 65536
  cabstg00:
    AccessPath: M:\Caboodle_Stage1
    FSLabel: Caboodle_Stage1
    AllocationUnitSize: 65536
  cabstg01:
    AccessPath: M:\Caboodle_Stage2
    FSLabel: Caboodle_Stage2
    AllocationUnitSize: 65536
  cabstg02: 
    AccessPath: M:\Caboodle_Stage3
    FSLabel: Caboodle_Stage3
    AllocationUnitSize: 65536
  cabstg03:
    AccessPath: M:\Caboodle_Stage4
    FSLabel: Caboodle_Stage4
    AllocationUnitSize: 65536
  cablog00:
    AccessPath: M:\Caboodle_ReportLog
    FSLabel: Caboodle_ReportLog
    AllocationUnitSize: 65536
  cablog01:
    AccessPath: M:\Caboodle_StageLog
    FSLabel: Caboodle_StageLog
    AllocationUnitSize: 65536
  cabtst:
    AccessPath: M:\Caboodle_Test
    FSLabel: Caboodle_Test
    AllocationUnitSize: 65536
  cabslic:
    AccessPath: M:\SlicerDicer
    FSLabel: SlicerDicer
    AllocationUnitSize: 65536
  cabaudit00:
    DriveLetter: F
    FSLabel: Caboodle_Audit
    AllocationUnitSize: 65536

Linux

storage_safe_mode: true # set to false when resizing PVs
storage_layout:
  - name: prdinst_vg
    disks:
      - instprd
    volumes:
      - name: epic_lv
        size: "20g"
        fs_type: xfs
        state: present
        mount_point: "/epic"
      - name: epictmp_lv
        size: "10g"
        fs_type: xfs
        state: present
        mount_point: "/epic/tmp"
      - name: epic_core_lv
        size: "5g"
        fs_type: xfs
        state: present
        mount_point: "/epic_core"
      - name: prd_lv
        size: "40g"
        fs_type: xfs
        state: present
        mount_point: "/epic/prd"
  - name: prd_vg
    grow_to_fill: false # set to true when resizing PVs
    type: lvm
    disks:
      - prdvg00
      - prdvg01
      - prdvg02
      - prdvg03
      - prdvg04
      - prdvg05
      - prdvg06
      - prdvg07
      - prdvg08
      - prdvg09
      - prdvg10
      - prdvg11
    volumes:
      - name: prd01_lv
        size: "6144g"
        raid_level: striped
        raid_stripe_size: 4M
        # verify striping with this command "lvs -o+lv_layout,stripes,stripe_size"
        mount_point: "/epic/prd01"
        fs_type: xfs
        state: present
  - name: prdjrn_vg
    disks:
      - jrnprd
    volumes:
      - name: prdjrn_lv
        size: "1399g"
        fs_type: xfs
        state: present
        mount_point: "/epic/jrn"
  - name: prdfiles_vg
    disks:
      - fileprd
    volumes:
      - name: prdfiles_lv
        size: "299g"
        fs_type: xfs
        state: present
        mount_point: "/epicfiles/prdfiles"