-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixes ansible-lint errors - Extract info and list states from ceph_key (1) by creating 2 new modules - Extract info from ceph_crush_rules (1) by creating an additional module (1) https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html#creating-an-info-or-a-facts-module Signed-off-by: Teoman ONAY <[email protected]>
- Loading branch information
Showing
62 changed files
with
2,385 additions
and
1,181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
major_changes: | ||
- Import ceph-ansible modules and fixes unittests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from __future__ import absolute_import, division, print_function | ||
__metaclass__ = type | ||
|
||
|
||
try: | ||
from ansible_collections.ceph.automation.plugins.module_utils.ceph_common import generate_cmd | ||
except ImportError: | ||
from module_utils.ceph_common import generate_cmd | ||
|
||
|
||
def get_rule(module, container_image=None): | ||
''' | ||
Get existing crush rule | ||
''' | ||
|
||
cluster = module.params.get('cluster') | ||
name = module.params.get('name') | ||
|
||
args = ['dump', name, '--format=json'] | ||
|
||
cmd = generate_cmd(sub_cmd=['osd', 'crush', 'rule'], | ||
args=args, | ||
cluster=cluster, | ||
container_image=container_image) | ||
|
||
return cmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from __future__ import absolute_import, division, print_function | ||
__metaclass__ = type | ||
|
||
|
||
def exec_commands(module, cmd_list): | ||
''' | ||
Execute command(s) | ||
''' | ||
|
||
for cmd in cmd_list: | ||
rc, out, err = module.run_command(cmd) | ||
if rc != 0: | ||
return rc, cmd, out, err | ||
|
||
return rc, cmd, out, err |
Oops, something went wrong.