Commit 8acf20a5 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

playbook/imt-vm-bootstrap: don't partition data disks anymore

The configuration of the data disk will be done manually (especially
since it may require GPT partition table now).
parent 9eba87c9
...@@ -2,11 +2,6 @@ ...@@ -2,11 +2,6 @@
hosts: 127.0.0.1 hosts: 127.0.0.1
connection: local connection: local
pre_tasks:
- name: Get mounted disk list
script: roles/vm-bootstrap/files/mounted_disk
register: vd_list
vars: vars:
logrotate_args: logrotate_args:
- name: vm-bootstrap - name: vm-bootstrap
...@@ -22,16 +17,6 @@ ...@@ -22,16 +17,6 @@
roles: roles:
- { role: vm-bootstrap, startup_playbook_id: imt-vm-bootstrap.yml } - { role: vm-bootstrap, startup_playbook_id: imt-vm-bootstrap.yml }
- ntp - ntp
- { role: vm-disks, vd_disk: b, data_n: 1, when: vd_list.stdout.find("vdb") != -1 }
- { role: vm-disks, vd_disk: c, data_n: 2, when: vd_list.stdout.find("vdc") != -1 }
- { role: vm-disks, vd_disk: d, data_n: 3, when: vd_list.stdout.find("vdd") != -1 }
- { role: vm-disks, vd_disk: e, data_n: 4, when: vd_list.stdout.find("vde") != -1 }
- { role: vm-disks, vd_disk: f, data_n: 5, when: vd_list.stdout.find("vdf") != -1 }
- { role: vm-disks, vd_disk: g, data_n: 6 ,when: vd_list.stdout.find("vdg") != -1 }
- { role: vm-disks, vd_disk: h, data_n: 7, when: vd_list.stdout.find("vdh") != -1 }
- { role: vm-disks, vd_disk: i, data_n: 8, when: vd_list.stdout.find("vdi") != -1 }
- { role: vm-disks, vd_disk: j, data_n: 9, when: vd_list.stdout.find("vdj") != -1 }
- { role: vm-disks, vd_disk: k, data_n: 10, when: vd_list.stdout.find("vdk") != -1 }
- role: logrotate - role: logrotate
logrotate_scripts: "{{ logrotate_args }}" logrotate_scripts: "{{ logrotate_args }}"
......
#!/bin/bash
DISK=$1
echo "n
p
1
w
"|fdisk $DISK
---
- name: stat /dev/vd{{ vd_disk }}
stat: path=/dev/vd{{ vd_disk }}
register: disk
- name: stat partition /dev/vd{{ vd_disk }}1
stat: path=/dev/vd{{ vd_disk }}1
register: partition_vd
- name: create partition script
copy: src=autofdisk dest=/usr/local/playbook-autofdisk mode=700
when: disk.stat.exists == True and partition_vd.stat.exists == False
- name: Create Partition
shell: /usr/local/playbook-autofdisk /dev/vd{{ vd_disk }}
when: disk.stat.exists == True and partition_vd.stat.exists == False
- name: Create Partition
filesystem: fstype=ext4 dev=/dev/vd{{ vd_disk }}1
when: disk.stat.exists == True and partition_vd.stat.exists == False
- name: stat partition /dev/vd{{ vd_disk }}1
stat: path=/dev/vd{{ vd_disk }}1
register: partition_vd_created
- name: Create directory /data{{ data_n }}
file: path=/data{{ data_n }} state=directory
when: partition_vd_created.stat.exists == True
- name: Mount /data{{ data_n }}
mount: name=/data{{ data_n }} src=/dev/vd{{ vd_disk }}1 fstype=ext4 state=mounted
when: partition_vd_created.stat.exists == True
- lineinfile: dest=/etc/opt/disks state=present line="vd{{ vd_disk }}" create=yes
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment