Improve logic for making systemd mount dependent on
network-online.target when network filesystem is being used.
This change improves feature implemented in commit [1].
Currently when device is specified by UUID or LABEL, dependency for
network-online.target is added even it's not a network filesystem.
We should be careful with this as it may create circular dependency.
In my case, circular dependency looked like this:
network.target ->
network-pre.target ->
netfilter-persistent.service ->
local-fs.target ->
var-lib-nova.mount ->
network-online.target ->
network.target
Additionally, this commit was originally supposed to add dependency also
for CIFS mounts(these ones starting from '//') but it never worked in my
opinion. It was also fixed by this change.
[1] 6a9dcb6886
Change-Id: I5d2d9c074aa0390a6f8b7c8c0ba1c839fe26f6c5
The mount unit can take requires and after statements which help ensure
mounts are "mounted" at the appropriate times. This change ensures that
mounts that do not begin with a "/" have network aware statements in
them automatically which ensures things like NFS, CIFS, or iSCSI mounts
are correctly handled at the time of system start.
Change-Id: I0afa240ea4792710b9d6e84831ccac01e0cb3972
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
The mount role was using the systemd module to start / stop mounts
however if a mount was restarted when it could have been reloaded
the role could create a fair amount of chaos in a running environment.
This change maps the mount states appropriately to the systemctl command
options to ensure we're not needlessly restarting mounts should the unit
files change. The `systemd_mount_states` has been added which will map
the normal Ansible states to suitable systemd mount states and the mount
state is being managed using the `systemctl` command instead of the
ansible module.
Change-Id: I5c7e5105e54d3ff9ad040f2a1d003d3dd12e4efb
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This change adds basic tests when creating a mount unit file.
This test will ensure system-mount is functional with a local mounts,
NFS mounts, and swap mounts.
Change-Id: I00dbf7f6ff3b687e622b29808197dbd7427d24fe
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>