Add support for configuration of LVM PVs, VGs and LVs
Currently we configure the seed with a single VG containing a volume for Docker volumes.
This commit is contained in:
parent
4010b3d6b9
commit
1260f9a87e
1
.gitignore
vendored
1
.gitignore
vendored
@ -17,6 +17,7 @@ ansible/*.retry
|
||||
# Ansible Galaxy roles
|
||||
ansible/roles/ahuffman.resolv/
|
||||
ansible/roles/jriguera.configdrive/
|
||||
ansible/roles/mrlesmithjr.manage-lvm/
|
||||
ansible/roles/MichaelRigart.interfaces/
|
||||
ansible/roles/resmo.ntp/
|
||||
ansible/roles/yatesr.timezone/
|
||||
|
39
ansible/group_vars/all/seed
Normal file
39
ansible/group_vars/all/seed
Normal file
@ -0,0 +1,39 @@
|
||||
---
|
||||
###############################################################################
|
||||
# Seed node configuration.
|
||||
|
||||
# List of seed VM LVM volume groups. See mrlesmithjr.manage-lvm role for
|
||||
# format.
|
||||
seed_lvm_groups:
|
||||
- "{{ seed_lvm_group_data }}"
|
||||
|
||||
# Seed LVM volume group for data. See mrlesmithjr.manage-lvm role for format.
|
||||
seed_lvm_group_data:
|
||||
vgname: data
|
||||
disks: "{{ seed_lvm_group_data_disks | join(',') }}"
|
||||
create: True
|
||||
lvnames: "{{ seed_lvm_group_data_lvs }}"
|
||||
|
||||
# List of disks for use by seed LVM data volume group. Default to an invalid
|
||||
# value to require configuration.
|
||||
seed_lvm_group_data_disks:
|
||||
- changeme
|
||||
|
||||
# List of LVM logical volumes for the data volume group.
|
||||
seed_lvm_group_data_lvs:
|
||||
- "{{ seed_lvm_group_data_lv_docker_volumes }}"
|
||||
|
||||
# Docker volumes LVM backing volume.
|
||||
seed_lvm_group_data_lv_docker_volumes:
|
||||
lvname: docker-volumes
|
||||
size: "{{ seed_lvm_group_data_lv_docker_volumes_size }}"
|
||||
create: True
|
||||
filesystem: "{{ seed_lvm_group_data_lv_docker_volumes_fs }}"
|
||||
mount: True
|
||||
mntp: /var/lib/docker/volumes
|
||||
|
||||
# Size of docker volumes LVM backing volume.
|
||||
seed_lvm_group_data_lv_docker_volumes_size: 75%VG
|
||||
|
||||
# Filesystem for docker volumes LVM backing volume. ext4 allows for shrinking.
|
||||
seed_lvm_group_data_lv_docker_volumes_fs: ext4
|
6
ansible/group_vars/controllers/lvm
Normal file
6
ansible/group_vars/controllers/lvm
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
###############################################################################
|
||||
# Controller node LVM configuration.
|
||||
|
||||
# List of LVM volume groups.
|
||||
lvm_groups: []
|
6
ansible/group_vars/seed/lvm
Normal file
6
ansible/group_vars/seed/lvm
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
###############################################################################
|
||||
# Seed node LVM configuration.
|
||||
|
||||
# List of LVM volume groups.
|
||||
lvm_groups: "{{ seed_lvm_groups }}"
|
10
ansible/lvm.yml
Normal file
10
ansible/lvm.yml
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
- name: Ensure LVM configuration is applied
|
||||
hosts: seed:controllers
|
||||
roles:
|
||||
- role: mrlesmithjr.manage-lvm
|
||||
manage_lvm: True
|
||||
become: True
|
||||
when:
|
||||
- "{{ lvm_groups is defined}}"
|
||||
- "{{ lvm_groups | length > 0 }}"
|
@ -2,5 +2,6 @@
|
||||
- src: ahuffman.resolv
|
||||
- src: jriguera.configdrive
|
||||
- src: MichaelRigart.interfaces
|
||||
- src: mrlesmithjr.manage-lvm
|
||||
- src: resmo.ntp
|
||||
- src: yatesr.timezone
|
||||
|
31
etc/kayobe/seed.yml
Normal file
31
etc/kayobe/seed.yml
Normal file
@ -0,0 +1,31 @@
|
||||
---
|
||||
# Seed node configuration.
|
||||
|
||||
###############################################################################
|
||||
# LVM configuration.
|
||||
|
||||
# List of seed VM LVM volume groups. See mrlesmithjr.manage-lvm role for
|
||||
# format.
|
||||
#seed_lvm_groups:
|
||||
|
||||
# Seed LVM volume group for data. See mrlesmithjr.manage-lvm role for format.
|
||||
#seed_lvm_group_data:
|
||||
|
||||
# List of disks for use by seed LVM data volume group.
|
||||
#seed_lvm_group_data_disks:
|
||||
|
||||
# List of LVM logical volumes for the data volume group.
|
||||
#seed_lvm_group_data_lvs:
|
||||
|
||||
# Docker volumes LVM backing volume.
|
||||
#seed_lvm_group_data_lv_docker_volumes:
|
||||
|
||||
# Size of docker volumes LVM backing volume.
|
||||
#seed_lvm_group_data_lv_docker_volumes_size:
|
||||
|
||||
# Filesystem for docker volumes LVM backing volume. ext4 allows for shrinking.
|
||||
#seed_lvm_group_data_lv_docker_volumes_fs:
|
||||
|
||||
###############################################################################
|
||||
# Dummy variable to allow Ansible to accept this file.
|
||||
workaround_ansible_issue_8743: yes
|
@ -138,7 +138,7 @@ class SeedHostConfigure(KollaAnsibleMixin, KayobeAnsibleMixin, Command):
|
||||
var_name="kayobe_ansible_user")
|
||||
playbooks = ["ansible/%s.yml" % playbook for playbook in
|
||||
"ip-allocation", "ssh-known-host", "kayobe-ansible-user",
|
||||
"disable-selinux", "network", "ntp"]
|
||||
"disable-selinux", "network", "ntp", "lvm"]
|
||||
ansible.run_playbooks(parsed_args, playbooks, limit="seed")
|
||||
kolla_ansible.run_seed(parsed_args, "bootstrap-servers",
|
||||
extra_vars={"ansible_user": ansible_user})
|
||||
@ -190,7 +190,7 @@ class OvercloudHostConfigure(KollaAnsibleMixin, KayobeAnsibleMixin, Command):
|
||||
var_name="kayobe_ansible_user")
|
||||
playbooks = ["ansible/%s.yml" % playbook for playbook in
|
||||
"ip-allocation", "ssh-known-host", "kayobe-ansible-user",
|
||||
"disable-selinux", "network", "ntp"]
|
||||
"disable-selinux", "network", "ntp", "lvm"]
|
||||
ansible.run_playbooks(parsed_args, playbooks, limit="controllers")
|
||||
kolla_ansible.run_overcloud(parsed_args, "bootstrap-servers",
|
||||
extra_vars={"ansible_user": ansible_user})
|
||||
@ -211,5 +211,5 @@ class OvercloudServiceDeploy(KollaAnsibleMixin, KayobeAnsibleMixin, Command):
|
||||
kolla_ansible.run_overcloud(parsed_args, command)
|
||||
# FIXME: Fudge to work around incorrect configuration path.
|
||||
extra_vars = {"node_config_directory": parsed_args.config_path}
|
||||
kolla_ansible.run_overcloud(parsed_args, command,
|
||||
kolla_ansible.run_overcloud(parsed_args, "post-deploy",
|
||||
extra_vars=extra_vars)
|
||||
|
Loading…
Reference in New Issue
Block a user