Table of Contents
Important
|
This is an example how most of the development in ansible-oracle is done.A Pull-Request is only accepted, when github-Actions are valid.
|
Important
|
This chapter shows, how the development envionment could look like. You need an Ansible-Controller with an Editor or IDE of your own choice. |
github has a great documentation with details about creating a fork and branch to contribute to ansible-oracle
.
Important
|
The github-Actions will automatically start, when the branchname starts with pr or in each Pull-Request.Please use a branch with 'pr'--prefix, when ansible-lint should be checked for each commit.
|
Important
|
pre-commit is a nice tool for git. Each commit is locally checked against multiple rules, to prevent failures in github-Actions after pushing commits to github. This tool is recommended but not mandatory for contributing to ansible-oracle .
|
Installation (cd into repository before)
pip install --user pre-commit pre-commit install
run outside git
pre-commit run
Important
|
python3 should point to Python >=3.9, otherwise ansible-navigator and ansible-lint could not beused. The activate script is used to change the Python environment in current shell.
|
configure venv for ansible-oracle
python3.10 -V Python 3.10.6 python3.10 -m venv ~/venv/ansible-oracle
install Python modules
. ~/venv/ansible-oracle/bin/activate pip --require-virtualenv -v install -r requirements_dev.txt
Start ansible-navigator
. ~/venv/ansible-oracle/bin/activate ansible-navigator --version ansible-navigator 3.3.0
Important
|
ansible-doctor has har dmodule dpendencies with conflicts between ansible-lint .
We have to use a dedicated venv for `ansible-doctor'
|
configure venv for ansible-oracle
python3 -m venv ~/venv/ansible-doctor
install Python modules
. ~/venv/ansible-doctor/bin/activate pip --require-virtualenv -v install -r requirements_doctor.txt
Start ansible-doctor
~/venv/ansible-doctor/bin/ansible-doctor --version ansible-doctor 2.0.4
Important
|
Do not forget to place change files in stage area of git before starting pre-commit .pre-commit works only on the data of the stage area!pre-commit could be executed without an active venv.
|
Start ansible-doctor with pre-commit
pre-commit run ansible-doctor
Start ansible-doctor to create new README.md file
cd ansible-oracle ~/venv/ansible-doctor/bin/ansible-doctor -f -r roles
Important
|
Don’t forget to set the working branch in requirements.yml .Remove/Disable devsec.hardening for faster installation of Ansible collection, when devsec should not be tested.
|
Edit requirements.yml
--- collections: # - name: devsec.hardening # version: 8.2.0 - name: https://github.com/Rendanic/ansible-oracle.git type: git version: devbranch
Execute ansible-playbook
ansible-galaxy collection install --force -r requirements.yml && ansible-playbook -i inventory/hasfd -e hostgroup='all' playbooks/single-instance-asm.yml --limit '*19c*'
The ansible-oracle project introduced antsibull-changelog
for managing the CHANGELOG.rst
based on fragments in changelogs/gragments
.
The ID should point to the PR and the filename describe the PR in short form. The fragments are part of the PR. If multiple PRs are open, the upper rule makes sure that no duplicate files are created during merge.
Important
|
Each Pull-Requests needs a fragment from Release 3.0.0 onwards! |
Important
|
This is only needed for creating new Releases in ansible-oracle - not for development!
|
cd ansible-oracle/docker docker-compose run --rm -w /git/ansible-oracle/example/beginner/ansible ansible bash pip3 install antsibull-changelog
antsibull-changelog release
reads galaxy.yml
to get the release version automatically.
The execution is aborted, when a release with the version is existing in CHANGELOG.rst
.
Note
|
The whole release process should be donw with a dedicated Pull-Request. |
antsibull-changelog release
Important
|
This is only an example how to do it, when custom images should be used. |
git clone https://github.com/Rendanic/bento.git cd bento git checkout oc cd packer_templates/oraclelinux/ ./oc_oracle-7.x_vbox.sh oracle-7.9-x86_64.json
Important
|
Change the boxname to an account with write priviledges. |
Upload new version after build:
boxname="Rendanic/oraclelinux-7.x" vagrantversion=$(date +%y%m%d) vagrant cloud version create ${boxname} "$vagrantversion" vagrant cloud provider create ${boxname} virtualbox "$vagrantversion" vagrant cloud provider upload ${boxname} virtualbox "$vagrantversion" ../../builds/oracle-7.9.virtualbox.box vagrant cloud publish --release ${boxname} "$vagrantversion" virtualbox
Docker pull Oracle XE
Normal SSO-Login from Oracle is needed for login to docker registry.
docker login container-registry.oracle.com docker pull container-registry.oracle.com/database/express:21.3.0-xe
Start Oracle Container for test
docker run -d --name oracle-xe \ -e ORACLE_PWD=Oracle_123 \ -p 1521:1521 \ container-registry.oracle.com/database/express:21.3.0-xe