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

New set of DebOps scripts #1455

Merged
merged 42 commits into from
Oct 26, 2021
Merged

Conversation

drybjed
Copy link
Member

@drybjed drybjed commented Aug 5, 2020

No description provided.

@drybjed drybjed added change requests to change existing functionality priority: medium labels Aug 5, 2020
@drybjed drybjed requested a review from tasosalvas as a code owner August 5, 2020 17:57
ypid
ypid previously approved these changes Aug 5, 2020
Copy link
Member

@ypid ypid left a comment

Choose a reason for hiding this comment

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

I went ahead and pushed small fixes to your branch in order to save time. Let me know if that works for you.

This looks good. Just some input about the interface to Ansible. I would try to keep the run and check subcommands a small wrapper around the Ansible commands, potentially passing all further arguments for the Ansible based subcommands directly without further parsing. That is just from my usage of DebOps. I just call ansible-playbook directly.

For me, the real benefit we can provide with the DebOps scripts is debops/debops-tools#164.

@drybjed
Copy link
Member Author

drybjed commented Aug 5, 2020

I went a head and pushed small fixes to your branch in order to save time. Let me know if that works for you.

Thanks. I'm not sure how you managed to do that, I guess write status on th debops/debops repository gives that access.

I actually wanted to siwtch the owner email to debops-devel, but decided against it. I guess that I should trust my gut feeling more. :)

This looks good. Just some input about the interface to Ansible. I would try to keep the run and check subcommands a small wrapper around the Ansible commands, potentially passing all further arguments for the Ansible based subcommands directly without further parsing. That is just from my usage of DebOps. I just call ansible-playbook directly.

That's what I plan to do. The debops run would be an equivalent of the current debops command, and debops check would be the same but with --diff --check added automatically for convenience.

For me, the real benefit we can provide with the DebOps scripts is debops/debops-tools#164.

We're starting from scratch so we can make things better - for example I'd like to git init the project directory automatically, etc. For now I'll try to fix the Travis-CI issues before merging the branch to master.

tasosalvas
tasosalvas previously approved these changes Aug 6, 2020
Copy link
Member

@tasosalvas tasosalvas left a comment

Choose a reason for hiding this comment

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

I'm making a note to update CLI Doc with the new usage. I might be a while, though... still crunching like a madman on my deployment.

@drybjed drybjed dismissed stale reviews from tasosalvas and ypid via ea90ad8 August 6, 2020 18:13
@drybjed drybjed force-pushed the debops-ng-initialization branch from bb9f76a to cd7daed Compare August 13, 2020 11:36
@drybjed drybjed force-pushed the debops-ng-initialization branch 4 times, most recently from 2eaa87a to 04a7033 Compare June 8, 2021 20:29
drybjed and others added 17 commits October 14, 2021 11:04
Removing that directory might break the "editable" install mode.
With these changes, the reach of Ansible during execution should be well
scoped inside of the 'ansible/collections/' subdirectory without
exposing other pieces of code outside of it.
This patch adds the ProjectDir class which defines basic DebOps project
directory structure. If needed, the class can create the project
directory on initialization and populate it with configuration files.
This patch adds support for generation of the 'ansible.cfg'
configuration file in the DebOps project directories. The configuration
contents are based on a basic template, user-specific configuration is
applied on top of the basic configuration.
The '--project-dir' option can be used to specify the path to the DebOps
project directory in subcommands which rely on it. This can be useful if
the 'debops' script is executed from outside of a valid DebOps project
directory.
The 'debops run' and 'debops check' commands can be used to execute
Ansible playbooks against hosts, or check any changes when they are
applied, respectively. Playbooks can be specified either as direct paths
to files with or without the '.yml' extansion, or defined as
'<namespace>.<collection/><path/to/playbook>' strings which will be
expanded by DebOps to use playbooks included in Ansible Collections.
This patch should ensure that Ansible Collections installed by the user
either in the project directory or in the user's home directory take
precendence over collections included with the 'debops' Python package.
Previously in the DebOps configuration structure, the current project
configuration was nested under ['projects'][name] key. This could be
used to modify specific project options from the global configuration,
however this caused the per-project configuration to require nesting
each time.

This patch changes the code so that the per-project configuration is on
the same level as global configuration. This should make the per-project
config files easier to write and understand. The global state between
DebOps project can be handled some other way in the future.
Ansible can find roles correctly inside of a Collection when the
'collections:' keyword is specified in a playbook.
@drybjed drybjed force-pushed the debops-ng-initialization branch from 04a7033 to 4742c3b Compare October 14, 2021 09:08
@drybjed drybjed force-pushed the debops-ng-initialization branch from 18f5a37 to 3e1d6b5 Compare October 26, 2021 20:43
@drybjed drybjed merged commit 57a479c into debops:master Oct 26, 2021
@drybjed drybjed deleted the debops-ng-initialization branch October 26, 2021 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change requests to change existing functionality priority: medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants