Replace systemd-mount template with role
To reduce role complexity we replace separatelly maintained template with systemd_mount role that is widely used across OSA. Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/836945 Change-Id: I23632f9c145be334b1d19067352f8b82114a1209
This commit is contained in:
parent
ed38f3393d
commit
337ddf8780
@ -1,19 +0,0 @@
|
|||||||
# This file is part of systemd.
|
|
||||||
#
|
|
||||||
# systemd is free software; you can redistribute it and/or modify it
|
|
||||||
# under the terms of the GNU Lesser General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2.1 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
[Unit]
|
|
||||||
Description=Virtual Machine and Container Storage
|
|
||||||
ConditionPathExists=/var/lib/machines.raw
|
|
||||||
|
|
||||||
[Mount]
|
|
||||||
What=/var/lib/machines.raw
|
|
||||||
Where=/var/lib/machines
|
|
||||||
Type=ext4
|
|
||||||
Options=loop,defaults,noatime,nodiratime
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
@ -32,27 +32,6 @@
|
|||||||
name: "systemd-importd.service"
|
name: "systemd-importd.service"
|
||||||
state: "restarted"
|
state: "restarted"
|
||||||
|
|
||||||
- name: Enable machines mount
|
|
||||||
systemd:
|
|
||||||
daemon_reload: yes
|
|
||||||
name: "var-lib-machines.mount"
|
|
||||||
enabled: "yes"
|
|
||||||
listen: Start machines mount
|
|
||||||
|
|
||||||
# NOTE(cloudnull): The systemd module is not used to start the
|
|
||||||
# mount because we dont want to "restart" the
|
|
||||||
# mount unnecessarily. To ensure we're able to
|
|
||||||
# load new options without requiring a mount
|
|
||||||
# restart the systemctl command is used with
|
|
||||||
# the "reload-or-restart" argument.
|
|
||||||
- name: Start or reload the machines mount
|
|
||||||
command: "systemctl reload-or-restart var-lib-machines.mount"
|
|
||||||
args:
|
|
||||||
warn: no
|
|
||||||
listen: Start machines mount
|
|
||||||
tags:
|
|
||||||
- skip_ansible_lint
|
|
||||||
|
|
||||||
- name: Restart irqbalance
|
- name: Restart irqbalance
|
||||||
systemd:
|
systemd:
|
||||||
name: "irqbalance"
|
name: "irqbalance"
|
||||||
|
@ -26,30 +26,20 @@
|
|||||||
when:
|
when:
|
||||||
- machines_create is changed
|
- machines_create is changed
|
||||||
|
|
||||||
- name: Create machines mount point
|
- name: Create systemd mount
|
||||||
file:
|
import_role:
|
||||||
path: "/var/lib/machines"
|
name: systemd_mount
|
||||||
state: "directory"
|
vars:
|
||||||
recurse: true
|
systemd_mounts:
|
||||||
|
- what: '/var/lib/machines.raw'
|
||||||
- name: Move machines mount into place
|
where: '/var/lib/machines'
|
||||||
copy:
|
type: 'ext4'
|
||||||
src: var-lib-machines.mount
|
options: 'loop'
|
||||||
dest: /lib/systemd/system/var-lib-machines.mount
|
unit:
|
||||||
register: mount_unit
|
ConditionPathExists:
|
||||||
|
- '/var/lib/machines.raw'
|
||||||
- name: Reload the System daemon
|
state: 'started'
|
||||||
systemd:
|
enabled: true
|
||||||
daemon_reload: yes
|
|
||||||
when: mount_unit is changed
|
|
||||||
|
|
||||||
- name: Mount all
|
|
||||||
shell: "mount | grep '/var/lib/machines' || (systemctl start var-lib-machines.mount && exit 3)"
|
|
||||||
register: mount_machines
|
|
||||||
changed_when: mount_machines.rc == 3
|
|
||||||
failed_when: mount_machines.rc not in [0, 3]
|
|
||||||
tags:
|
|
||||||
- skip_ansible_lint
|
|
||||||
|
|
||||||
- name: Remove the old image cache
|
- name: Remove the old image cache
|
||||||
file:
|
file:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user