This refactor makes the 'name' argument not mandatory because when
'state' is 'info' we shouldn't need to pass it.
The second change is just a duplicate code removal.
Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
With ansible-core 2.15 it is not possible to pass argument of unexpected
type, as otherwise module will fail with:
`'None' is not a string and conversion is not allowed`
With that we want to only get all existing crush rules, so we can simply
supply an empty string as a name argument, which would satisfy
requirements and have same behaviour for previous ansible versions.
Alternative approach would be to stop making `name` as a required
argument to the module and use empty string as default value
when info state is used.
Signed-off-by: Dmitriy Rabotyagov <noonedeadpunk@gmail.com>
When creating a RBD pool it needs to be initialized as per documentation[1]
Modified (pre_)generate_ceph_cmd to make it usable with any command with
the same parameters as the ceph command
[1]https://docs.ceph.com/en/latest/rbd/rados-rbd-cmds/#create-a-block-device-pool
Signed-off-by: Teoman ONAY <tonay@redhat.com>
This adds ceph_crush_rule ansible module for replacing the command
module usage with the ceph osd crush rule commands.
This module can manage both erasure and replicated crush rules.
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>