1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-03-28 18:53:47 +08:00
This commit is contained in:
PascalKont 2026-03-26 18:41:32 +01:00 committed by GitHub
commit ffe8424e68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 39 deletions

View File

@ -1,6 +1,7 @@
# ansible plugin
The `ansible plugin` adds several aliases for useful [ansible](https://docs.ansible.com/ansible/latest/index.html) commands and [aliases](#aliases).
The `ansible plugin` adds several aliases for useful
[ansible](https://docs.ansible.com/ansible/latest/index.html) commands and [aliases](#aliases).
To use it, add `ansible` to the plugins array of your zshrc file:
@ -10,22 +11,19 @@ plugins=(... ansible)
## Aliases
| Command | Description |
|:-------------------------------------------|:--------------------------------------------------------------------|
| `ansible-version` / `aver` | Show the version on ansible installed in this host |
| `ansible-role-init <role name>` / `arinit` | Creates the Ansible Role as per Ansible Galaxy standard |
| `a` | command `ansible` |
| `aconf` | command `ansible-config` |
| `acon` | command `ansible-console` |
| `ainv` | command `ansible-inventory` |
| `aplaybook` | command `ansible-playbook` |
| `adoc` | command `ansible-doc` |
| `agal` | command `ansible-galaxy` |
| `apull` | command `ansible-pull` |
| `aval` | command `ansible-vault` |
| Command | Description |
| :------------------ | :-------------------------- |
| `a` | command `ansible` |
| `acon` | command `ansible-console` |
| `aconf` | command `ansible-config` |
| `adoc` | command `ansible-doc` |
| `agal` | command `ansible-galaxy` |
| `ainv` | command `ansible-inventory` |
| `aplb`, `aplaybook` | command `ansible-playbook` |
| `apull` | command `ansible-pull` |
| `ates` | command `ansible-test` |
| `aval` | command `ansible-vault` |
## Maintainer
### [Deepankumar](https://github.com/deepan10)
[https://github.com/deepan10/oh-my-zsh/tree/features/ansible-plugin](https://github.com/deepan10/oh-my-zsh/tree/features/ansible-plugin)
### [PascalKont](https://github.com/PascalKont)

View File

@ -1,28 +1,12 @@
# Functions
function ansible-version(){
ansible --version
}
function ansible-role-init(){
if ! [ -z $1 ] ; then
echo "Ansible Role : $1 Creating...."
ansible-galaxy init $1
tree $1
else
echo "Usage : ansible-role-init <role name>"
echo "Example : ansible-role-init role1"
fi
}
# Alias
alias a='ansible '
alias aconf='ansible-config '
alias acon='ansible-console '
alias aver='ansible-version'
alias arinit='ansible-role-init'
alias aplaybook='ansible-playbook '
alias ainv='ansible-inventory '
alias aconf='ansible-config '
alias adoc='ansible-doc '
alias agal='ansible-galaxy '
alias ainv='ansible-inventory '
alias aplaybook='ansible-playbook ' # this long version of the playbook alias is kept for backwards compatibility
alias aplb='ansible-playbook ' # cannot use aplay because of collision with 'aplay' command for playing audio files
alias apull='ansible-pull '
alias aval='ansible-vault'
alias ates='ansible-test '
alias aval='ansible-vault '