With update of ansible-lint to version >=6.0.0 a lot of new
linters were added, that enabled by default. In order to comply
with linter rules we're applying changes to the role.
With that we also update metdata to reflect current state.
Change-Id: I8bd832c172ef87acca27f053c5223941d80f9ce1
Since ansible-core 2.14 you can't use warn as module argument.
It's being removed to avoid module failure.
Change-Id: I7287d449b8fd0ad970e37aa63b5cb25f88197858
In case of setting file permissions to 640 systemd will raise an
alert [1]. In order to avoid spamming in logs, we change default mode to
644 as no passwords or credentials are going to be stored in this file.
With that we provide a way to override file mode if needed.
[1] https://paste.openstack.org/show/b83tSrjni8iB2WNsvDfQ/
Change-Id: I73164e9d4b02d7b3fae21b912369afcd1cc64abf
This line was introduced by I680359ca655d0f69a40e9d29dbf1694cd0aa4ca2
for convenience, and should already be covered by the
distribution_major_version line above.
Change-Id: I8aba13ef29571730f9260dc2f6af33c168185780
Currently "Set the state of the mount" task reports changed state
every time, which makes impression that role is not idempotent.
We fix that by adding `changed_when: false` to the task.
Change-Id: I3deca051530b3c5497d70b9bc06f39483e8ef4ce
Use a first_found lookup instead of a with_first_found loop so that
the 'paths' parameter can be used.
This ensures that only vars from the role are included, and not vars
from a parent calling role. This can happen when a parent role has
a higher priority vars file available for inclusion than the role
it calls.
Change-Id: Idbeb3e61d0398944af8d73db5d98352de95b91a7
Since we still use ceph-ansible that has their own implementation of
config_template module it's worth to use mentioned module as a collection
explicitly.
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/819814
Change-Id: I69c8682c40a61e87156c1615c3b3eab67a76abe8
All references to Gentoo, SUSE, Debian stretch and Centos-7 are removed.
Conditional tasks, ternary operators and variables are simplified where possible
OS specific variables files are generalised where possible
Change-Id: I55037805e59cb6d727593f467e98568a4c030e74
Currently it's deployer resposibility to install required binaries for
mounts to succeed, which is not really convenient. Instead of this
we can try to provide at least some basic binaries installation in case
supported type is set.
Depends-On: https://review.opendev.org/755484
Change-Id: I680359ca655d0f69a40e9d29dbf1694cd0aa4ca2
We assume that the deployer knows what they are doing so remove
these tasks which add extra runtime to deployments and CI tests.
Change-Id: I4806ce34a38375461f4de1cc69c7e05cd86ff602
The mount state could be volitile making it so the "restart-or-reload"
option fails to execute. If this happens the task will now be rescued
and the mount state will be attempted using the regular systemd
module.
Change-Id: I86fc03ad7c72fa4cfdfc598f552f936dda653926
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>