diff --git a/.python-version b/.python-version index 3a4f41ef..7c7a975f 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.13 \ No newline at end of file +3.10 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c48154c..3176557d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Do a port knocking in `certbot_check.yml` task. +- Command `run` to execute Ansible commands. ### Changed @@ -27,3 +28,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated more bash scripts including ansible-vault-get, get-public-ip, docker-mysql-list, and docker-mysql-drop. - Changed shebang from #!/bin/bash to #!/usr/bin/env bash for portability. - Merged `odoo_scripts` into `odoo` role. +- Set Python version to `3.10`. +- Remove version check in `requirements.txt`. diff --git a/roles/ssh/README.md b/roles/ssh/README.md index 392f0529..1f777e5c 100644 --- a/roles/ssh/README.md +++ b/roles/ssh/README.md @@ -22,3 +22,13 @@ And include it in your playbook. roles: - role: ssh ``` + +## Docs + +### Show OpenSSH version + +Show OpenSSH version for alls hosts. + +```bash +task run all -i inventories/setup -a "ssh -V" +``` \ No newline at end of file diff --git a/task b/task index 663c9080..1b9aecbf 100755 --- a/task +++ b/task @@ -1,8 +1,8 @@ #!/usr/bin/env bash help-table() { - local cmd_width=24 - local opt_width=24 + local cmd_width=30 + local opt_width=26 local desc_width=70 local column="| %-${cmd_width}s | %-${opt_width}s | %-${desc_width}s |\n" @@ -51,6 +51,7 @@ help-table() { printf "$column" 'pull-repos' '' 'Pull git repos in inventories folder.' # Run printf "$column" 'play' '' 'Run ansible-playbook command.' + printf "$column" 'run' '' 'Run ansible command.' printf "$column" 'connect-host' '[host]' 'Connect to host with configs.' # Test printf "$column" 'test-localhost' '[cleanup]' 'Deploy to localhost. Pass option '\''cleanup'\'' to reset test env.' @@ -330,6 +331,10 @@ play() { ansible-playbook "$@" } +run() { + ansible "$@" +} + upgrade() { echo "Update Ansible" uv pip install --upgrade ansible