Chore
* chore: Add manual release action
In this action:
- pre-commit hook is run
- tox is run for a master
After these check succeedes:
- a new commit with changed version and changelog is pushed to master
- a new tag is added to the commit above with particular release version
- a new mrack package is being release to PyPi
(prerequisite: secret with PYPI_TOKEN - already set)
Signed-off-by: Tibor Dudlák <tdudlakredhat.com> ([`01ea068`](https://github.com/neoave/mrack/commit/01ea068c51fe59738644b51f0deb2527f31f2990))
* chore: Add check-commits action for commits
Checks the future commit headers to be compatible with
the project python-semantic-release.
Signed-off-by: Tibor Dudlák <tdudlakredhat.com> ([`1716abf`](https://github.com/neoave/mrack/commit/1716abf8aacd9cbdb32fb48531bf056b4d4db57e))
* chore: Add pre-commit github action
Signed-off-by: Tibor Dudlák <tdudlakredhat.com> ([`ace1da3`](https://github.com/neoave/mrack/commit/ace1da3555e568500f32535aabca4aebdb192447))
* chore: Add mypy to the .pre-commit-config.yaml
Signed-off-by: Tibor Dudlák <tdudlakredhat.com> ([`6e3319f`](https://github.com/neoave/mrack/commit/6e3319faf2d577928493243e532168cdea6848d6))
* chore: Add pre-commit configuration files
Signed-off-by: Tibor Dudlák <tdudlakredhat.com> ([`7095ee0`](https://github.com/neoave/mrack/commit/7095ee08640a07a5139fba0270cecc3dc8d60679))
Feature
* feat: Output file paths configurable in mrack config
Adding a possibility to change Ansible inventory and pytest multihost
configuration output file paths in a mrack config file. So that a user
can use directly a custom location.
Example of such config:
ini
[mrack]
mrackdb = config/mrackdb.json
provisioning-config = config/provisioning-config.yaml
metadata = config/metadata.yaml
ansible-inventory = config/test.inventory.yaml
pytest-multihost = config/pytest-multihost-config.yaml
Signed-off-by: Petr Vobornik <pvoborniredhat.com> ([`1761baf`](https://github.com/neoave/mrack/commit/1761baf1da0c75e8bb86ec423e3b563bdfb18871))
* feat: Simple way to add hosts into /etc/hosts file
This is useful for cases where the fake hostname needs to be used
e.g. when accessing FreeIPA Web UI which is sensitive on used hostname.
It is uncomfortable task to read the values from `mrack list` and add
them manualy to /etc/hosts.
The change introduces two commands to help with this case:
* `$ mrack eh add` to add all active hosts into /etc/hosts
* `$ mrack eh clear` to remove all records added by mrack.
Mrack adds two markers into the /etc/hosts file and adds records
between them. This should work also with multiple runs of mrack in
separate tests. If the section already contains the fake hostname then
this line is overwritten with a new value. This is useful when
provisioning hosts for the same task after they were previously
removed.
Signed-off-by: Petr Vobornik <pvoborniredhat.com> ([`da24ac5`](https://github.com/neoave/mrack/commit/da24ac55a3189512c98884eb30f1b5a6ad4dd46a))
Fix
* fix: Use meta_ prefix for parent domain
When inventory was created the expected key value
for the parent_domain in host section should be
meta_parent_domain playbook will not fail with:
The error was: &39;meta_parent_domain&39; is undefined
Signed-off-by: Tibor Dudlák <tdudlakredhat.com> ([`aaeeb58`](https://github.com/neoave/mrack/commit/aaeeb58c0682dbd7be9db94dcb7469c07e6243eb))
* fix: Add missing annotations for mypy
Signed-off-by: Tibor Dudlák <tdudlakredhat.com> ([`2427b15`](https://github.com/neoave/mrack/commit/2427b15ddd12b4d7813a51b3b276b8affd42259b))
* fix: Remove deprecated flag --recursive from Makefile
Remove deprecated flag --recursive for the isort
Add command to sort setup.py.
Signed-off-by: Tibor Dudlák <tdudlakredhat.com> ([`48937f3`](https://github.com/neoave/mrack/commit/48937f38a3b8e2780d39539c513187591b9a953d))
* fix: Move common methods to transfromer.py
Move common methods to transfromer.py
to have less copy pasted code.
Added more debug messages to transformation procedure.
Signed-off-by: Tibor Dudlák <tdudlakredhat.com> ([`4ea839e`](https://github.com/neoave/mrack/commit/4ea839e560a3d11662d2b65309993652b4cd44bd))
Refactor
* refactor: Add Status badges for PyPI and docs
Signed-off-by: Tibor Dudlák <tdudlakredhat.com> ([`2f5e25a`](https://github.com/neoave/mrack/commit/2f5e25a8d6976c763dc0d31f91682595e2ed212c))
* refactor: Refactor setup.py and configure release
Refactor setup.py to use version from src/mrack/__init__
Add configuration values for python semantic release
to the pyproject.toml and set default branch for releases.
Signed-off-by: Tibor Dudlák <tdudlakredhat.com> ([`544baf6`](https://github.com/neoave/mrack/commit/544baf67afff1f91be99ff2167915d901501d9ad))
* refactor: Update README.md file
Update README.md file with sections:
where example inventory output is shown
where usage of the mrack is explained
Signed-off-by: Tibor Dudlák <tdudlakredhat.com> ([`127dd03`](https://github.com/neoave/mrack/commit/127dd031068215673196839a85b5260f25774a9a))
* refactor: Update files after make format
Previous commit which updated .isort.cfg file
would cause failures in testing with black
and isort afterwards.
Signed-off-by: Tibor Dudlák <tdudlakredhat.com> ([`6ba0bec`](https://github.com/neoave/mrack/commit/6ba0bec908acadb1085d339e881cf97f954e6832))
* refactor: Fixing the pre-commit eof-check failures
Signed-off-by: Tibor Dudlák <tdudlakredhat.com> ([`93ab0ac`](https://github.com/neoave/mrack/commit/93ab0ac6db0a4091e4f8c83763204d2213a6c44c))
* refactor: Update yamls that yamllint was complaining about
Update yamls that yamllint was complaining about
Update python version to 3.9
Signed-off-by: Tibor Dudlák <tdudlakredhat.com> ([`3c08ec4`](https://github.com/neoave/mrack/commit/3c08ec454a3593aaf2e3f69f89f20fc1481b8c62))
* refactor: Add dsp_name to logging messages to display context
Add dsp_name to logging messages to display context
for prioviders and transformers.
Added some debug messages.
Signed-off-by: Tibor Dudlák <tdudlakredhat.com> ([`4c13b6f`](https://github.com/neoave/mrack/commit/4c13b6f5d89006f7886182fe2c83dbdecdf1b585))
Unknown
* 0.4.0
Automatically generated by python-semantic-release ([`4d359ac`](https://github.com/neoave/mrack/commit/4d359acb40aa2852942966140262a6fc1cd2a4e0))
* MrackConfig: alternative approach
This commit implements a MrackConfig which allows to define options
and arguments otherwise needed in a configuration file and thus
save people&39;s time with writing them in CLI.
Config file looks like:
[mrack]
mrackdb = config/mrackdb.yaml
provisioning-config = config/provisioning-config.yaml
metadata = config/metadata.yaml
Where each value is optional and existance of the config is also
optional.
Mrack looks for the config on these locations:
- user provided path via -c or --mrack-config global option
- ./mrack.conf
- ~/.mrack/mrack.conf
- /etc/mrack/mrack.conf
It also changes CLI of commands:
- metadata is no longer an argument but an option: -m or --metadata
- provisioning config shortcut changes to global -p
With these changes it is possible to define a config file to allow
just typing:
$ mrack up
$ mrack list
$ mrack ssh
$ mrack output
$ mrack destroy
The MrackConfig class is also extensible for new use cases.
Signed-off-by: Petr Vobornik <pvoborniredhat.com> ([`84e52a2`](https://github.com/neoave/mrack/commit/84e52a29090a66d5ba06c9ea8d7a5de48001f4c9))
* Add mrack.conf from which we load defaults
Add mrack.conf which contains default enfironment
configuration in ini format for the click options
- `--config=provisioning-config from mrack.conf`
- `--db=mrackdb from mrack.conf`
Load default for options from the mrack.conf file from:
1. use `$(pwd)/mrack.conf` or other way the `./mrack.conf` - actual directory
2. or use user home directory configuration - `~/.mrack/mrack.conf`
3. alternatively directory `/etc/mrack/mrack.conf` as safe fallback.
Add example `mrack.conf` and `provisioning-config.yaml`
to the `data/` directory in repository.
Update setup.py to install required files from `data/` dir. ([`951c08f`](https://github.com/neoave/mrack/commit/951c08fb9e80c3dc099751e08f6ed16594c7362d))
* Update .gitignore for python projects
Signed-off-by: Tibor Dudlák <tdudlakredhat.com> ([`8f9a674`](https://github.com/neoave/mrack/commit/8f9a67435304497132b0f0cc1d0a2c17e76cc4e7))
* Support netbios in windows host definition for the inventory
Signed-off-by: Tibor Dudlák <tdudlakredhat.com> ([`1916058`](https://github.com/neoave/mrack/commit/1916058f57aea85da42f34b4f300866c228403ed))
* Give preference to metadata ssh_key_filename in pytest multihost
If job metadata contains a ssh_key_filename, use it for pytest
multihost configuration. I.e. do no override with key used by mrack.
Signed-off-by: Petr Vobornik <pvoborniredhat.com> ([`a1cad10`](https://github.com/neoave/mrack/commit/a1cad10b33034a8244d1f15fec54e56e96d257f3))
* Do not set username for pytest multihost config
We have actually not used it at it cannot be assumed that
the user used for provisioning should be used for pytest-multihost.
E.g. a lot of tests rely on root - to be able to completely control
the remote machine. That cannot be done, e.g. with default cloud-user.
(Though it can often sudo to root)
Let&39;s keep there the more simple configuration, where user is the
same for all host and is defined in provisioning config &39;mhcfg&39; dir.
Signed-off-by: Petr Vobornik <pvoborniredhat.com> ([`7bb230e`](https://github.com/neoave/mrack/commit/7bb230e170ac0a2373a2316ef23a26bfcb681ad9))
* Fix OpenStack provisioning status translation
It is not needed to use a STATUS_MAP for translation status in
prov_result_to_host_data as it is done also in to_host of parent
class. Double translation doesn&39;t work and thus everything provisioned
had incorrecly status : &34;other&34;.
This has then a negative effect on ssh actione where no host is reported
as active.
Signed-off-by: Petr Vobornik <pvoborniredhat.com> ([`a9d62cc`](https://github.com/neoave/mrack/commit/a9d62ccd9206f594dc4b2abec1020a22607980a2))
* Do not show traceback on ApplicationError
So that, e.g., on ssh action, when there are no active host, user
will not get an exception ending with:
raise ApplicationError(&34;No active host available.&34;)
But only:
No active host available.
Which is more user friendly.
Signed-off-by: Petr Vobornik <pvoborniredhat.com> ([`99c5ab1`](https://github.com/neoave/mrack/commit/99c5ab1ca747da35576a6300cd54a0cd1230d867))
* Increase OpenStack timeout to 6mins
Trying to make the provider more stable if OpenStack is slow, e.g.
under load.
It&39;s not very clever method. But might work.
Signed-off-by: Petr Vobornik <pvoborniredhat.com> ([`7854c49`](https://github.com/neoave/mrack/commit/7854c4937742ec5ee0cbe05370c324061b3ebdfd))