Skip to content
This repository has been archived by the owner on Dec 2, 2022. It is now read-only.

Commit

Permalink
Add scm property to requirements role (#66)
Browse files Browse the repository at this point in the history
Fixes: #65
  • Loading branch information
ssbarnea authored Jun 2, 2021
1 parent 856c03b commit 01fa90b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
1 change: 1 addition & 0 deletions examples/reqs4/meta/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
- src: https://github.com/bennojoy/nginx
- src: git+http://bitbucket.org/willthames/git-ansible-galaxy
version: v1.4
scm: git
- include: foo.yml
20 changes: 19 additions & 1 deletion f/ansible-requirements.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,30 @@
"title": "Name",
"type": "string"
},
"scm": {
"anyOf": [
{
"enum": [
"git"
],
"type": "string"
},
{
"enum": [
"hg"
],
"type": "string"
}
],
"default": "git",
"title": "Scm"
},
"src": {
"title": "Src",
"type": "string"
},
"version": {
"default": "*",
"default": "master",
"title": "Version",
"type": "string"
}
Expand Down
2 changes: 1 addition & 1 deletion src/ansibleschemas/_modules.py

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/ansibleschemas/requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ class CollectionStringModel(BaseModel):


class RoleModel(BaseModel):
# https://galaxy.ansible.com/docs/using/installing.html#installing-multiple-roles-from-a-file
name: Optional[str]
src: Optional[str]
version: Optional[str] = "*"
version: Optional[str] = "master"
scm: Optional[Union[Literal["git"], Literal["hg"]]] = "git"

class Config:
title = "Role"
Expand Down

0 comments on commit 01fa90b

Please sign in to comment.