Skip to content

Commit

Permalink
python-venv: helper for easier development in ansible-oracle
Browse files Browse the repository at this point in the history
  • Loading branch information
Rendanic committed Sep 24, 2023
1 parent 0dd6a45 commit 1655735
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@
.vagrant
*.pub
LINUX.X64_*.zip

# ignore for ansible-navigator
playbooks/collections
ansible-navigator.log
navigator/replay/*json
14 changes: 14 additions & 0 deletions ansible-navigator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
ansible-navigator:
execution-environment:
enabled: false
environment-variables:
set:
ANSIBLE_CONFIG: ansible.cfg
logging:
level: warning
mode: stdout
playbook-artifact:
enable: true
replay: "{playbook_dir}/../navigator/replay/{playbook_name}-{time_stamp}.json"
save-as: "{playbook_dir}/../navigator/replay/{playbook_name}-{time_stamp}.json"
3 changes: 3 additions & 0 deletions changelogs/fragments/dev-tools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
minor_changes:
- "python-venv: helper for easier development in ansible-oracle (oravirt#318)"
50 changes: 50 additions & 0 deletions tools/dev/install_dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env bash
set -eu
set -o pipefail

basedir=$(dirname -- "$0")

##########################
##### ansible-oracle #####
##########################

echo "venv for ansible-oracle"
venv_dir=~/venv/ansible-oracle
test -d "${venv_dir}" 2>/dev/null || python3 -m venv "${venv_dir}"

# shellcheck source=/dev/null
source "${venv_dir}"/bin/activate

echo "install pip modules"
pip --require-virtualenv install -q -r "${basedir}/requirements_dev.txt"
pip list

##########################
##### ansible-doctor #####
##########################

echo "venv for ansible-doctor"
venv_dir=~/venv/ansible-doctor
test -d "${venv_dir}" 2>/dev/null || python3 -m venv "${venv_dir}"

# shellcheck source=/dev/null
source "${venv_dir}"/bin/activate

echo "install pip modules"
pip --require-virtualenv install -q -r "${basedir}/requirements_doctor.txt"
pip list

###############################
##### antsibull-changelog #####
###############################

echo "venv for antsibull-changelog"
venv_dir=~/venv/antsibull
test -d "${venv_dir}" 2>/dev/null || python3 -m venv "${venv_dir}"

# shellcheck source=/dev/null
source "${venv_dir}"/bin/activate

echo "install pip modules"
pip --require-virtualenv install -q -r "${basedir}/requirements_antsibull.txt"
pip list
18 changes: 18 additions & 0 deletions tools/dev/requirements_antsibull.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# This file is needed for antsibull-changelog
#
# create python-venv:
# python3 -m venv ~/venv/antsibull
#
# install with:
# . ~/venv/antsibull/bin/activate
# pip --require-virtualenv -v install -r tools/dev/requirements_ansibull.txt
#
# execute antsibull-changelog:
# ~/venv/antsibull/bin/antsibull-changelog
#
# older version of ansible is needed for ansible-oracle
# otherwise the ansible-doc gets errors due to problems with ansible-oracle-modules
# They need some refactoring...
ansible-core==2.15.4
antsibull-changelog==0.23.0
18 changes: 18 additions & 0 deletions tools/dev/requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# This file is for all developer who wants to use the usual tools in ansible-oracle.
#
# pip modules for ansible-oracle development
# Important:
# Make sure to use Python >= 3.9 for ansible-lint.
#
# create python-venv:
# python3 -m venv ~/venv/ansible-oracle
#
# install with:
# . ~/venv/ansible-oracle/bin/activate
# pip --require-virtualenv -v install -r tools/dev/requirements_dev.txt
#
# ansible-doctor==2.0.3
ansible-lint==6.16.0
ansible-navigator==3.3.1
pre-commit
18 changes: 18 additions & 0 deletions tools/dev/requirements_doctor.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# This file is needed for ansible-doctor
# Due to dependency issues between ansible-lint and ansible-doctor,
# a dedicated venv is needed for ansible-doctor.
# See following issue for reason:
# https://github.com/thegeeklab/ansible-doctor/issues/495
#
# create python-venv:
# python3 -m venv ~/venv/ansible-doctor
#
# install with:
# . ~/venv/ansible-doctor/bin/activate
# pip --require-virtualenv -v install -r tools/dev/requirements_doctor.txt
#
# execute ansible-doctor:
# ~/venv/ansible-doctor/bin/ansible-doctor
#
ansible-doctor==2.0.4

0 comments on commit 1655735

Please sign in to comment.