Skip to content

Commit 50bd387

Browse files
authored
F #44: Add poetry-managed optional venv (#48)
1 parent 996af7f commit 50bd387

4 files changed

Lines changed: 31 additions & 7 deletions

File tree

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
*.swp
22
*.tar.gz
33
__pycache__/
4-
.galaxy-key
5-
.galaxy-server
64
/ansible_collections/*
75
!/ansible_collections/opennebula/deploy
86
/inventory/.one-deploy/
@@ -20,3 +18,4 @@ __pycache__/
2018
!/inventory/federation-slave2.yml
2119
!/inventory/evpn-ha.yml
2220
/.env.yml
21+
/poetry.lock

Makefile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
SHELL := $(shell which bash)
22
SELF := $(patsubst %/,%,$(dir $(abspath $(firstword $(MAKEFILE_LIST)))))
33

4+
POETRY_BIN ?= $(shell command -v poetry)
5+
POETRY_RUN := $(if $(POETRY_BIN),$(POETRY_BIN) run,)
6+
47
I ?= $(SELF)/inventory/example.yml
58
INVENTORY ?= $(I)
69

@@ -28,14 +31,17 @@ infra pre ceph site main: _TAGS := $(if $(TAGS),-t $(TAGS),)
2831
infra pre ceph site main: _SKIP_TAGS := $(if $(SKIP_TAGS),--skip-tags $(SKIP_TAGS),)
2932
infra pre ceph site main: _VERBOSE := $(if $(VERBOSE),-$(VERBOSE),)
3033
infra pre ceph site main:
31-
cd $(SELF)/ && ansible-playbook $(_VERBOSE) -i $(INVENTORY) $(_TAGS) $(_SKIP_TAGS) opennebula.deploy.$@
34+
cd $(SELF)/ && $(POETRY_RUN) ansible-playbook $(_VERBOSE) -i $(INVENTORY) $(_TAGS) $(_SKIP_TAGS) opennebula.deploy.$@
35+
36+
.PHONY: requirements requirements-poetry requirements-python requirements-galaxy
3237

33-
.PHONY: requirements requirements-python requirements-galaxy
38+
requirements: requirements-$(if $(POETRY_RUN),poetry,python) requirements-galaxy
3439

35-
requirements: requirements-python requirements-galaxy
40+
requirements-poetry: $(SELF)/pyproject.toml
41+
poetry update --directory $(dir $<)
3642

3743
requirements-python: $(SELF)/requirements.txt
3844
pip3 install --requirement $<
3945

4046
requirements-galaxy: $(SELF)/requirements.yml
41-
ansible-galaxy collection install --requirements-file $<
47+
$(POETRY_RUN) ansible-galaxy collection install --requirements-file $<

galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ version: 1.0.0
66
readme: README.md
77

88
authors:
9-
- http://opennebula.io <contact@opennebula.io>
9+
- OpenNebula <contact@opennebula.io>
1010
description: HA DEPLOYMENT FOR OPENNEBULA (ANSIBLE)
1111

1212
license: []

pyproject.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[tool.poetry]
2+
name = "one-deploy"
3+
version = "1.0.0"
4+
description = ""
5+
authors = ["OpenNebula <contact@opennebula.io>"]
6+
7+
license = "Apache-2.0"
8+
readme = "README.md"
9+
10+
[tool.poetry.dependencies]
11+
ansible-core = "<2.16"
12+
molecule = "*"
13+
netaddr = "*"
14+
pyone = "*"
15+
python = "^3.9"
16+
17+
[build-system]
18+
requires = ["poetry-core"]
19+
build-backend = "poetry.core.masonry.api"

0 commit comments

Comments
 (0)