Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new module sqitch to manage changes in databases #20809

Closed
wants to merge 32 commits into from

Conversation

merito
Copy link

@merito merito commented Jan 29, 2017

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

Sqitch

ANSIBLE VERSION
ansible 2.3.0
  config file = 
  configured module search path = Default w/o overrides
SUMMARY

Sqitch is a database change management system. It works with many database engines. I've made a module to work with some of the sqitch commands usable in provisioning database (I didn't implement commands for editing scripts, configs and plans).

TASK [db_test : Sqitch] ****************************************************
changed: [localhost] => {
    "changed": true, 
    "invocation": {
        "module_args": {
            "command": "deploy", 
            "cwd": "/home/merito/ansible_dev/roles/db_test/files", 
            "dest_dir": null, 
            "engine": null, 
            "from_change": null, 
            "log_only": null, 
            "mode": null, 
            "onto": null, 
            "plan_file": "sqitch.plan", 
            "set": [], 
            "set_deploy": null, 
            "set_revert": null, 
            "target": "anstest", 
            "to_change": "error_code", 
            "upto": null, 
            "verify": true
        }, 
        "module_name": "sqitch"
    }, 
    "stdout": "Deploying changes through error_code to anstest\n  + types ....... ok\n  + error_code .. ok\n", 
    "stdout_lines": [
        "Deploying changes through error_code to anstest", 
        "  + types ....... ok", 
        "  + error_code .. ok"
    ]
}

@ansibot ansibot added affects_2.3 This issue/PR affects Ansible v2.3 module This issue/PR relates to a module. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. needs_triage Needs a first human triage before being processed. new_module This PR includes a new module. new_plugin This PR includes a new plugin. labels Jan 29, 2017
@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label Jan 30, 2017
@ansibot
Copy link
Contributor

ansibot commented Jan 30, 2017

@jsmartin @drewkerrigan @slok @ThePixelDeveloper @barryib @Lujeni @nerzhul

As a maintainer of a module in the same namespace this new module has been submitted to, your vote counts for shipits. Please review this module and add shipit if you would like to see it merged.

click here for bot help

@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Jan 30, 2017
@merito
Copy link
Author

merito commented Mar 30, 2017

It's been a long time since I've made this PR. What will happen with this if nobody reacts?

@nerzhul
Copy link
Contributor

nerzhul commented Mar 30, 2017

hello, code seems good, but i don't really know this technology

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Apr 11, 2017
@ansibot ansibot added the support:community This issue/PR relates to code supported by the Ansible community. label Jun 29, 2017
@tsal
Copy link

tsal commented Oct 6, 2017

We could really use this module - any chance of it moving forward at this point?

@merito
Copy link
Author

merito commented Oct 9, 2017

I've checked the module with the current ansible and it still works good. I don't know if there is any way to push it forward. Because it was more than 9 months I call the people to look at this

@jsmartin @drewkerrigan @slok @ThePixelDeveloper @barryib @Lujeni @nerzhul

Copy link

@drewkerrigan drewkerrigan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shipit

@tsal
Copy link

tsal commented Oct 10, 2017

🎉

@ansibot ansibot added the new_contributor This PR is the first contribution by a new community member. label Oct 18, 2017
@merito
Copy link
Author

merito commented Oct 24, 2017

@tsal One shipit is not enough to include it to the package, we need two. You can still use this module copying the code to the ./library directory in your project root or wherever your library path is pointing out - see this http://docs.ansible.com/ansible/latest/intro_configuration.html#library

@tsal
Copy link

tsal commented Oct 26, 2017

I was hoping it would be a cascade of shipits after @drewkerrigan :( - thank you, we'll probably do that, for now. 🎉

@drewkerrigan
Copy link

FWIW, myself and @jsmartin worked on the code in question several years ago, so I'd be surprised if this was still on the radar of anyone listed above.

@ansibot ansibot removed the new_contributor This PR is the first contribution by a new community member. label Nov 3, 2017
@ansibot ansibot added the new_contributor This PR is the first contribution by a new community member. label Jan 22, 2018
@maxamillion
Copy link
Contributor

I'd like to see integration tests added. Also, any desire to support check mode? (Is that even feasible with sqitch?)

If we can get tests, I'll merge.

@ansibot ansibot added test This PR relates to tests. and removed stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Feb 8, 2018
@maxamillion
Copy link
Contributor

Shippable tests are failing.

@maxamillion
Copy link
Contributor

needs_revision

@ansibot
Copy link
Contributor

ansibot commented Feb 8, 2018

The test ansible-test sanity --test boilerplate [explain] failed with the error:

Command "test/sanity/code-smell/boilerplate.sh" returned exit status 2.
>>> Standard Output
== Missing __metaclass__ = type ==
./lib/ansible/modules/database/misc/sqitch.py

== Missing from __future__ import (absolute_import, division, print_function) ==
./lib/ansible/modules/database/misc/sqitch.py

The test ansible-test sanity --test integration-aliases [explain] failed with the error:

Command "test/sanity/code-smell/integration-aliases.py" returned exit status 1.
>>> Standard Output
The following integration target directories are missing `aliases` files:

test/integration/targets/sqitch

If these tests cannot be run as part of CI (requires external services, unsupported dependencies, etc.),
then they most likely belong in `test/integration/roles/` instead of `test/integration/targets/`.
In that case, do not add an `aliases` file. Instead, just relocate the tests.

However, if you think that the tests should be able to be supported by CI, please discuss test
organization with @mattclay or @gundalow on GitHub or #ansible-devel on IRC.

If these tests can be run as part of CI, you'll need to add an appropriate CI alias, such as:

posix/ci/group1
windows/ci/group2

The CI groups are used to balance tests across multiple jobs to minimize test run time.
Using the relevant `group1` entry is fine in most cases. Groups can be changed later to redistribute tests.

Aliases can also be used to express test requirements:

needs/privileged
needs/root
needs/ssh

Other aliases are used to skip tests under certain conditions:

skip/freebsd
skip/osx
skip/python3

Take a look at existing `aliases` files to see what aliases are available and how they're used.

The test ansible-test sanity --test pep8 [explain] failed with 49 errors:

lib/ansible/modules/database/misc/sqitch.py:216:22: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:216:24: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:217:20: E221 multiple spaces before operator
lib/ansible/modules/database/misc/sqitch.py:217:20: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:217:26: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:219:22: E221 multiple spaces before operator
lib/ansible/modules/database/misc/sqitch.py:219:22: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:219:26: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:220:19: E221 multiple spaces before operator
lib/ansible/modules/database/misc/sqitch.py:220:19: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:220:26: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:221:19: E221 multiple spaces before operator
lib/ansible/modules/database/misc/sqitch.py:221:19: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:221:26: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:222:16: E221 multiple spaces before operator
lib/ansible/modules/database/misc/sqitch.py:222:16: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:222:26: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:223:22: E221 multiple spaces before operator
lib/ansible/modules/database/misc/sqitch.py:223:22: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:223:26: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:224:24: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:224:26: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:225:21: E221 multiple spaces before operator
lib/ansible/modules/database/misc/sqitch.py:225:21: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:225:26: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:226:19: E221 multiple spaces before operator
lib/ansible/modules/database/misc/sqitch.py:226:19: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:226:26: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:227:17: E221 multiple spaces before operator
lib/ansible/modules/database/misc/sqitch.py:227:17: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:227:26: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:228:16: E221 multiple spaces before operator
lib/ansible/modules/database/misc/sqitch.py:228:16: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:228:26: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:229:21: E221 multiple spaces before operator
lib/ansible/modules/database/misc/sqitch.py:229:21: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:229:26: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:230:17: E221 multiple spaces before operator
lib/ansible/modules/database/misc/sqitch.py:230:17: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:230:26: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:231:17: E221 multiple spaces before operator
lib/ansible/modules/database/misc/sqitch.py:231:17: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:231:26: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:232:23: E221 multiple spaces before operator
lib/ansible/modules/database/misc/sqitch.py:232:23: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:232:26: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:233:23: E221 multiple spaces before operator
lib/ansible/modules/database/misc/sqitch.py:233:23: E251 unexpected spaces around keyword / parameter equals
lib/ansible/modules/database/misc/sqitch.py:233:26: E251 unexpected spaces around keyword / parameter equals

The test ansible-test sanity --test validate-modules [explain] failed with 5 errors:

lib/ansible/modules/database/misc/sqitch.py:0:0: E307 version_added should be 2.5. Currently 2.3
lib/ansible/modules/database/misc/sqitch.py:0:0: E312 No RETURN provided
lib/ansible/modules/database/misc/sqitch.py:0:0: E316 ANSIBLE_METADATA.metadata_version: required key not provided @ data['metadata_version']. Got None
lib/ansible/modules/database/misc/sqitch.py:0:0: E316 ANSIBLE_METADATA.version: extra keys not allowed @ data['version']. Got '1.0'
lib/ansible/modules/database/misc/sqitch.py:0:0: E322 "dest_dir" is listed in the argument_spec, but not documented in the module

click here for bot help

@merito
Copy link
Author

merito commented Sep 14, 2018

@mattclay so why during the execution of tasks from setup.yml output_dir is /root/ansible_testing/

00:45 TASK [sqitch : Copy resources to tmp dir] **************************************
00:48 changed: [testhost] => {"changed": true, "dest": "/root/ansible_testing/", "src": "/root/ansible/test/integration/targets/sqitch/files/"}

but next in test.yml it is ~/ansible_testing

01:27 fatal: [testhost]: FAILED! => {
01:27     "changed": false, 
01:27     "invocation": {
01:27         "module_args": {
01:27             "command": "deploy", 
01:27             "engine": null, 
01:27             "from_change": null, 
01:27             "log_only": null, 
01:27             "mode": null, 
01:27             "onto": null, 
01:27             "plan_file": "sqitch.plan", 
01:27             "set": [], 
01:27             "set_deploy": [], 
01:27             "set_revert": [], 
01:27             "target": "anstest", 
01:27             "to_change": "types", 
01:27             "upto": null, 
01:27             "verify": true, 
01:27             "working_directory": "~/ansible_testing"
01:27         }
01:27     }, 
01:27     "msg": "Cannot find target \"anstest\"\n", 
01:27     "rc": 2
01:27 }

and it is not the same directory as before?

@mattclay
Copy link
Member

The tests are running as root. It appears the path is being used/shown literally in some cases (~/ansible_testing) and other places it's been expanded to /root/ansible_testing.

@mattclay mattclay added the ci_verified Changes made in this PR are causing tests to fail. label Sep 14, 2018
@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label Sep 14, 2018
@ansibot ansibot added stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. stale_review Updates were made after the last review and the last review is more than 7 days old. labels Sep 22, 2018
@merito
Copy link
Author

merito commented Nov 16, 2018

@mattclay all the conversations are resolved. Are we waiting for any changes?

@merito
Copy link
Author

merito commented Jan 26, 2019

The output_dir appears to be working correctly:

01:31 TASK [sqitch : Create dir for resources] ***************************************
01:32 ok: [testhost] => {"changed": false, "gid": 0, "group": "root", "mode": "0755", "owner": "root", "path": "/root/ansible_testing", "size": 4096, "state": "directory", "uid": 0}

@mattclay it is resolved. Maybe it is a good content to next Big PR review? ;)

@mattclay mattclay dismissed their stale review February 13, 2019 20:06

Review out-of-date.

@ansibot ansibot removed the stale_review Updates were made after the last review and the last review is more than 7 days old. label Feb 13, 2019
@ansibot ansibot added the database Database category label Feb 21, 2019
@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Mar 4, 2020
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Mar 28, 2020
@ansibot ansibot added collection Related to Ansible Collections work collection:community.general support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Apr 29, 2020
@Akasurde
Copy link
Member

Hi @merito, Thank you very much for your interest in Ansible. This plugin/module is no longer maintained in this repository and has been migrated to https://github.com/ansible-collections/community.general

If you have further questions please stop by IRC or the mailing list:

* IRC: #ansible on irc.freenode.net
* mailing list: https://groups.google.com/forum/#!forum/ansible-project

needs_info

@Akasurde Akasurde closed this Aug 20, 2020
@ansible ansible locked as resolved and limited conversation to collaborators Aug 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.3 This issue/PR affects Ansible v2.3 collection:community.general collection:t_systems_mms.icinga_director collection Related to Ansible Collections work database Database category module This issue/PR relates to a module. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. new_contributor This PR is the first contribution by a new community member. new_module This PR includes a new module. new_plugin This PR includes a new plugin. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants