Files
pvc-ansible/roles/pvc/tasks/main.yml
Joshua M. Boniface 07d75573d6 Add updated tuning configuration
Uses a much nicer CPU tuning configuration, leveraging systemd's
AllowedCPUs and CPUAffinity options within a set of slices (some
default, some custom).

Configuration is also greatly simplified versus the previous
implementation, simply asking for a number of CPUS for both the system
and OSDs, and calculating everything else that is required.

Also switches (back) to the v2 unified cgroup hierarchy by default as
required by the systemd AllowedCPUs directive.
2023-09-01 15:42:29 -04:00

72 lines
1.5 KiB
YAML

---
# Set this_node fact
- set_fact:
this_node: "{{ inventory_hostname.split('.')[0] }}"
tags: always
# Set coordinator state fact
- set_fact:
is_coordinator: "{% for node in pvc_nodes if node.hostname == this_node %}{{ node.is_coordinator }}{% endfor %}"
tags: always
# First-run check
- name: check if this is a new instance
shell: "echo 'bootstrapped' > /etc/pvc-install.pvc"
args:
creates: /etc/pvc-install.pvc
register: newhost_check
tags: always
- name: set newhost fact
set_fact:
newhost: yes
when: newhost_check.changed
tags: always
- include: common/add_cluster_ips.yml
when: newhost is defined and newhost
tags: always
# Install system tweaks
- include: system/main.yml
tags: pvc-system
# Install base databases (coordinators only)
- include: ceph/main.yml
tags: pvc-ceph
when: is_coordinator
- include: zookeeper/main.yml
tags: pvc-zookeeper
when: is_coordinator
- include: patroni/main.yml
tags: pvc-patroni
when: is_coordinator
# Install core services
- include: libvirt/main.yml
tags: pvc-libvirt
- include: frr/main.yml
tags: pvc-frr
# Install PVC daemon
- include: pvc/main.yml
tags: pvc-daemon
# Install CPU tuning
- include: cputuning/main.yml
tags: pvc-cputuning
when: cpu_tuning is defined
- name: restart server on first install
shell: 'sleep 3 && shutdown -r now "Ansible updates triggered"'
async: 1
poll: 0
ignore_errors: yes
become: yes
when: newhost is defined and newhost
tags: always