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 adr0001 - why project pravic? #12

Merged

Conversation

jillr
Copy link
Contributor

@jillr jillr commented Jan 18, 2023

SUMMARY

Initialize ADR directory
Add an architectural decision record with the rational behind the project

ISSUE TYPE
  • Docs Pull Request
COMPONENT NAME

adr

ADDITIONAL INFORMATION

This ADR should be circulated widely to the community before merging

@softwarefactory-project-zuul
Copy link

Build failed.

✔️ build-ansible-collection SUCCESS in 3m 44s
ansible-test-sanity-docker-devel FAILURE in 7m 31s (non-voting)
ansible-test-sanity-docker-milestone FAILURE in 30m 39s (non-voting)
ansible-test-sanity-docker-stable-2.14 FAILURE in 7m 37s
ansible-test-units-cloud-pravic-python39 FAILURE in 6m 10s
ansible-galaxy-importer FAILURE in 3m 29s

docs/adr/0001-why-pravic.md Outdated Show resolved Hide resolved
docs/adr/0001-why-pravic.md Outdated Show resolved Hide resolved

In the above example, the VPC must be created before any other resources and the security group must be created before the instance and the elastic cache. We could identify this both through the resource references in the resource definition and by analyzing the AWS schemas for these resources.

### Asynchronous Execution
Copy link
Member

Choose a reason for hiding this comment

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

I feel like this section could be a bit clearer. It switches back and forth between talking about Ansible's async execution and pravic's async execution. They're both useful, but the main selling point with pravic is that the playbook author doesn't need to think about it. Asynchronous execution isn't a playbook level feature, it's just built directly into the collection.

@softwarefactory-project-zuul
Copy link

Build failed.

✔️ build-ansible-collection SUCCESS in 3m 33s
ansible-test-sanity-docker-devel FAILURE in 6m 58s (non-voting)
ansible-test-sanity-docker-milestone FAILURE in 7m 32s (non-voting)
ansible-test-sanity-docker-stable-2.14 FAILURE in 7m 17s
ansible-test-units-cloud-pravic-python39 TIMED_OUT in 1h 00m 48s
ansible-galaxy-importer FAILURE in 4m 00s

@alinabuzachis
Copy link
Contributor

recheck

@softwarefactory-project-zuul
Copy link

Build succeeded.

✔️ build-ansible-collection SUCCESS in 3m 29s
✔️ ansible-test-sanity-docker-devel SUCCESS in 8m 05s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 6m 24s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 6m 10s
✔️ ansible-test-units-cloud-pravic-python39 SUCCESS in 4m 16s
✔️ ansible-galaxy-importer SUCCESS in 3m 31s
✔️ ansible-test-integration-cloud-pravic SUCCESS in 5m 27s

@dmsimard
Copy link

dmsimard commented Feb 10, 2023

I think I understand the use case and I want to share how I create infrastructure with ansible (sometimes), in case it could give you ideas.

TL;DR: I create myself a role or playbook and then use that as an interface to the various modules. I wouldn't really say it's declarative (I'm not interested in arguing about that) but you could say the imperative part is mostly hidden away behind an abstraction layer: the role or playbook :p

I can supply these the necessary vars (what image, ssh key, firewall rules, or virtual networks, etc) in a lot of ways, from the inventory, as extra vars or a vars file that looks like the example from this PR under Resource Declaration.
Underneath, there can be conditions, assertions, handlers or async... anything that ansible makes possible.

For an example playbook that creates things on digitalocean where I also end up adding the host to the inventory such that I can deploy on top of it once it's up and available: https://github.com/ansible-community/ara-infra/blob/5bf45600148e7dfa8e1c92f801a71a0ddb9157fc/playbooks/digitalocean_infra.yaml#L78-L83

For a role example, I have an (unfortunately closed source) role called azure_vm which does something a bit like this (but with other resources, including the resource group, etc): https://github.com/ansible-collections/azure/blob/48c2c251fcc9ada0c9a39c58d34216b9fae85722/tests/integration/targets/azure_rm_virtualmachine/tasks/azure_test_minimal_manageddisk.yml#L1-L45

I have some sane defaults set up in role variables such that I don't need to specify everything and some are omitted if not provided but you get the idea.

I say this because Collections can ship roles and playbooks now, not only modules and plugins. They could be used as abstraction layers to manage infrastructure a bit like this ¯\(ツ)

In other words, there could be an aws_vm (or whatever, naming is hard) role in the collection that creates not just the VM but the things above, underneath and around it. There could be one for azure, one for gcp, one for docker or podman (that'd even take care of installing them if they're not installed?) and so on.

I don't have all the answers, it wouldn't be the fastest and it probably doesn't tick all of the boxes but could be an interesting approach, perhaps.

Of course, I like the regular ansible approach because then I have reporting on every individual playbook, host and task with ara :p

@jillr
Copy link
Contributor Author

jillr commented Feb 20, 2023

@dmsimard I understand where you're coming from for the use case of VMs, but public cloud is so incredibly vast we can't even keep up with modules let alone create and support roles for everything our users do on public cloud. Generated collections have been explored by both Ansible and GCP and this helps, but it's still an ongoing game of catch-up. Abstracting resources in this way, rather than creating a single module for every resource on every hyperscaler, gives users a more direct and faster way to use new resource types as they're made available on the hyperscaler's resource management API.

Unfortunately it's really not feasible or us to make roles for everything. We just don't have nearly enough people (combined in the community and Ansible eng) to attempt something like this for even one hyperscaler for enough resources to be broadly useful.

@alinabuzachis
Copy link
Contributor

recheck

@softwarefactory-project-zuul
Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/5da2b49614cc49b69e23cce7478b903b

✔️ build-ansible-collection SUCCESS in 6m 47s
ansible-test-sanity-docker-devel FAILURE in 7m 08s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 9m 11s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 7m 09s
✔️ ansible-test-units-cloud-pravic-python39 SUCCESS in 4m 51s
✔️ ansible-galaxy-importer SUCCESS in 3m 33s
✔️ ansible-test-integration-cloud-pravic SUCCESS in 5m 26s

@softwarefactory-project-zuul
Copy link

Build succeeded (gate pipeline).
https://ansible.softwarefactory-project.io/zuul/buildset/41089be9c900468dae33ae3ea0a56b84

✔️ build-ansible-collection SUCCESS in 6m 55s
ansible-test-sanity-docker-devel FAILURE in 9m 55s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 6m 43s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 9m 25s
✔️ ansible-test-units-cloud-pravic-python39 SUCCESS in 4m 42s
✔️ ansible-galaxy-importer SUCCESS in 3m 40s
✔️ ansible-test-integration-cloud-pravic SUCCESS in 5m 26s

@softwarefactory-project-zuul
Copy link

Pull request merge failed: Resource not accessible by integration, You may need to manually rebase your PR and retry.

jillr and others added 4 commits April 3, 2023 12:03
Add an architectural decision record with the rational behind the project
Co-authored-by: Mike Graves <mgraves@redhat.com>
Co-authored-by: Mike Graves <mgraves@redhat.com>
@softwarefactory-project-zuul
Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/5ab5c0e692a0414c9f692a52dc24abd7

✔️ build-ansible-collection SUCCESS in 6m 59s
ansible-test-sanity-docker-devel FAILURE in 8m 37s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 9m 03s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 10m 25s
✔️ ansible-test-units-cloud-pravic-python39 SUCCESS in 4m 45s
✔️ ansible-galaxy-importer SUCCESS in 3m 56s
✔️ ansible-test-integration-cloud-pravic SUCCESS in 11m 38s

@softwarefactory-project-zuul
Copy link

Build succeeded (gate pipeline).
https://ansible.softwarefactory-project.io/zuul/buildset/8ca500bc447b40fb973b0e3ccf4a61a6

✔️ build-ansible-collection SUCCESS in 6m 47s
ansible-test-sanity-docker-devel FAILURE in 6m 49s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 8m 06s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 6m 43s
✔️ ansible-test-units-cloud-pravic-python39 SUCCESS in 4m 25s
✔️ ansible-galaxy-importer SUCCESS in 3m 31s
✔️ ansible-test-integration-cloud-pravic SUCCESS in 9m 18s

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 20f6cd8 into ansible-collections:main Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants