pyinfra-dev / pyinfra-dev/pyinfra
Possible new pattern: Combine inventory / group_data ?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6k
- Forks
- 548
- Avg merge
- 7d 17h
- Merged PRs (30d)
- 13
Description
I've been playing with combining inventory + group_data files lately, since group_data tends to be directly associated with a group of hosts inside an inventory file. Seems to work out of the box, the only thing one has to remember is:
group_datamust bename=value.- Dicts and lists are interpreted as inventory.
Seems to be a pretty decent architectural simplification for pyinfra, eliminates the need for a separate directory full of group_data.
Thoughts?
Sample (ex: pyinfra/inventory/production.py)
from inventory.__common__ import *
role = 'production'
url = ''
user_name = 'guy'
user_password = ''
workspace = f'/home/{user_name}/workspace'
ssh_user = user_name
ssh_port = 22
ssh_key = f'../keys/{role}/{role}'
hosts = [
('10.0.0.80', {**locals()}),
('10.0.0.81', {**locals()}),
('10.0.0.82', {**locals()}),
]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue provides the example file pyinfra/inventory/production.py but names no implementation entry point or test. Start by locating how inventory and group_data are currently loaded, then establish whether the proposed combined pattern is supported and what tests and documentation would define completion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100