Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

cockroachdb_info: new module #18

Merged
merged 21 commits into from
Nov 17, 2021

Conversation

Andersson007
Copy link
Collaborator

@Andersson007 Andersson007 commented Nov 9, 2021

SUMMARY

Fetches server info from CockroachDB server

TODO:

  • Add unit tests
  • Add more info to fetch
    • Server version
    • Database info
    • User info
    • Cluster settings
    • Cluster regions info
    • ...

Example:

- name: Fetch information from CockroachDB
  community.cockroachdb.cockroachdb_info:
  register: result

- name: Print information returned from the previous task
  ansible.builtin.debug:
    var: result
    verbosity: 2

Will return something like

'version': {
  'raw': 'CockroachDB CLL 21.4.1 ...',
  'year': 22,
  'release': 4,
  'patch': 1,
},
'databases': {
    "defaultdb": {
        "comment": null,
        "owner": "root",
        "primary_region": null,
        "regions": [],
        "survival_goal": null
    },
    "postgres": {
        "comment": null,
        "owner": "root",
        "primary_region": null,
        "regions": [],
        "survival_goal": null
    },
    "system": {
        "comment": null,
        "owner": "node",
        "primary_region": null,
        "regions": [],
        "survival_goal": null
    },
},
"users": {
     "admin": {
        "member_of": [],
        "options": ""
    },
    "root": {
        "member_of": [
            "admin"
        ],
        "options": ""
    }
},
"settings": {
    "bulkio.backup.read_retry_delay": {
            "setting_type": "d",
            "value": "5s"
    },
    "bulkio.backup.read_with_priority_after": {
        "setting_type": "d",
        "value": "1m0s"
    },
    ....
},
'regions': {},
...
ISSUE TYPE
  • Feature Pull Request

@codecov
Copy link

codecov bot commented Nov 9, 2021

Codecov Report

Merging #18 (acf8bb7) into main (842671f) will increase coverage by 3.26%.
The diff coverage is 99.30%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #18      +/-   ##
==========================================
+ Coverage   91.50%   94.76%   +3.26%     
==========================================
  Files           4        6       +2     
  Lines         200      344     +144     
  Branches       23       39      +16     
==========================================
+ Hits          183      326     +143     
  Misses         12       12              
- Partials        5        6       +1     
Impacted Files Coverage Δ
plugins/modules/cockroachdb_info.py 98.50% <98.50%> (ø)
...ests/unit/plugins/modules/test_cockroachdb_info.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 842671f...acf8bb7. Read the comment docs.

@Andersson007 Andersson007 changed the title [WIP] cockroachdb_info: new module cockroachdb_info: new module Nov 17, 2021
@Andersson007 Andersson007 merged commit 7b772dd into ansible-collections:main Nov 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant