aboutsummaryrefslogtreecommitdiff
path: root/tools/setup-compute-libvirt.yml
blob: d544d262617b4d8fb3a0959b83f00dce97d39fed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# This playbook modifies the system shutdown sequence to ensure that
# nova-compute is shutdown safely, including guests, when used in
# conjunction with systemd-machined and libvirt.
---
- name: Set up compute libvirts to shutdown guests safely
  hosts: compute
  become: true
  vars:
    systemd_artifacts:
      - "kolla-libvirt-guests-{{ container_engine }}.service"
      - virt-guest-shutdown.target
  tasks:
    - name: Install systemd artifacts
      copy:
        src: "{{ item }}"
        dest: "/usr/lib/systemd/system/{{ item }}"
      with_items: "{{ systemd_artifacts }}"

    - name: Enable/start systemd artifacts
      systemd:
        enabled: true
        state: started
        name: "{{ item }}"
      with_items: "{{ systemd_artifacts }}"