Commit Graph

7 Commits

Author SHA1 Message Date
Damian Dabrowski 480bb0c871 Fix mount's systemd unit dependency logic
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
2022-12-28 09:46:48 +00:00
Dmitriy Rabotyagov 483b10e5e9 Add option to use s3fs with role
Change-Id: I5cf6353a30190aa0a2f0856530a65c48437ed5ea
2021-01-05 13:52:45 +02:00
Kevin Carter 6a9dcb6886 Ensure mounts are able to be network aware
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>
2019-01-04 20:06:45 +00:00
Kevin Carter d1dc867ef1
Change mount states to ensure uptime
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>
2018-03-30 14:47:13 -05:00
Kevin Carter 031ba51726
Add basic tests
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>
2018-03-23 18:12:18 -05:00
Kevin Carter 3791c7520b
fix swap/mount section name when type = swap
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-03-13 10:59:48 -05:00
Kevin Carter 4f37977e7b
Initial Commit
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-03-13 02:06:48 -05:00