a29950146b9d992caf880679dfce90c6a1ef2eea

Author
Robby Russell <robby@planetargon.com>
Committer
GitHub <noreply@github.com>
Date

Message

Merge pull request #7386 from deepan10/features/ansible-plugin

ansible plugin added

Diff

 1diff --git a/plugins/ansible/README.md b/plugins/ansible/README.md
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..38bc13775287f2e307dbc437c8f5990fc0da6d9f
 4--- /dev/null
 5+++ b/plugins/ansible/README.md
 6@@ -0,0 +1,35 @@
 7+# ansible plugin
 8+
 9+## Introduction
10+
11+The `ansible plugin` adds several aliases for useful [ansible](https://docs.ansible.com/ansible/latest/index.html) commands and [aliases](#aliases).
12+
13+To use it, add `ansible` to the plugins array of your zshrc file:
14+
15+```
16+plugins=(... ansible)
17+```
18+
19+## Aliases
20+
21+| Command                                    | Description                                                         |
22+|:-------------------------------------------|:--------------------------------------------------------------------|
23+| `ansible-version` / `aver`                 | Show the version on ansible installed in this host                  |
24+| `ansible-role-init <role name>` / `arinit` | Creates the Ansible Role as per Ansible Galaxy standard             |
25+| `a`                                        | command `ansible`                                                   |
26+| `aconf`                                    | command `ansible-config`                                            |
27+| `acon`                                     | command `ansible-console`                                           |
28+| `aconn`                                    | command `ansible-connection`                                        |
29+| `ainv`                                     | command `ansible-inventory`                                         |
30+| `aplay`                                    | command `ansible-playbook`                                          |
31+| `ainv`                                     | command `ansible-inventory`                                         |
32+| `adoc`                                     | command `ansible-doc`                                               |
33+| `agal`                                     | command `ansible-galaxy`                                            |
34+| `apull`                                    | command `ansible-pull`                                              |
35+| `aval`                                     | command `ansible-vault`                                             |
36+
37+## Maintainer
38+
39+### [Deepankumar](https://github.com/deepan10) 
40+
41+[https://github.com/deepan10/oh-my-zsh/tree/features/ansible-plugin](https://github.com/deepan10/oh-my-zsh/tree/features/ansible-plugin)
42diff --git a/plugins/ansible/ansible.plugin.zsh b/plugins/ansible/ansible.plugin.zsh
43new file mode 100644
44index 0000000000000000000000000000000000000000..0e7aff528b0210a33a9e22c26de47bbb2d5dadf7
45--- /dev/null
46+++ b/plugins/ansible/ansible.plugin.zsh
47@@ -0,0 +1,29 @@
48+# Functions
49+function ansible-version(){
50+    ansible --version
51+}
52+
53+function ansible-role-init(){
54+    if ! [ -z $1] ; then
55+        echo "Ansible Role : $1 Creating...."
56+        ansible-galaxy init $1
57+        tree $1
58+    else
59+        echo "Usage : ansible-role-init <role name>"
60+        echo "Example : ansible-role-init role1"
61+    fi
62+}
63+
64+# Alias
65+alias a='ansible '
66+alias aconf='ansible-config '
67+alias acon='ansible-console '
68+alias aconn='ansible-connection '
69+alias aver='ansible-version'
70+alias arinit='ansible-role-init'
71+alias aplay='ansible-playbook '
72+alias ainv='ansible-inventory '
73+alias adoc='ansible-doc '
74+alias agal='ansible-galaxy '
75+alias apull='ansible-pull '
76+alias aval='ansible-vault'