zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@zsh.org>
To: Zsh workers <zsh-workers@zsh.org>
Subject: PATCH: complete for another ansible variable
Date: Mon, 19 Apr 2021 11:58:28 +0200	[thread overview]
Message-ID: <12602-1618826308.769636@wv8v.ZfED.RB9V> (raw)

This adds completion of inventory plugins in assignments to
ANSIBLE_INVENTORY_ENABLED. There are lots more variables most of which I
never use.

Also, ansible-inventory now takes hosts or groups as a normal parameter
and the login action has been removed from ansible-galaxy role at some
point. They now require an API key.

Oliver

diff --git a/Completion/Unix/Command/_ansible b/Completion/Unix/Command/_ansible
index 9de9b6675..c81308586 100644
--- a/Completion/Unix/Command/_ansible
+++ b/Completion/Unix/Command/_ansible
@@ -1,4 +1,4 @@
-#compdef ansible ansible-config ansible-console ansible-doc ansible-galaxy ansible-inventory ansible-playbook ansible-pull ansible-vault -value-,ANSIBLE_STDOUT_CALLBACK,-default-
+#compdef ansible ansible-config ansible-console ansible-doc ansible-galaxy ansible-inventory ansible-playbook ansible-pull ansible-vault -value-,ANSIBLE_STDOUT_CALLBACK,-default- -value-,ANSIBLE_INVENTORY_ENABLED,-default-
 
 local curcontext="$curcontext" plug plugvar subcmd ign ret=1
 local -a args state line expl gactions
@@ -9,6 +9,10 @@ case $service in
     plug=callback
     state=plugins
   ;;
+  *,ANSIBLE_INVENTORY_ENABLED,*)
+    plug=inventory
+    state=plugins
+  ;;
   ansible|ansible-console|ansible-doc|ansible-playbook)
     args=(
       \*{-M+,--module-path=}'[specify path to modules]:module path:_dir_list'
@@ -125,6 +129,7 @@ case $service in
       '(-y --yaml --vars --graph)--toml[use TOML format instead of JSON]'
       '(-y --yaml)--vars[add variables to the graph display]'
       '(-y --yaml --toml --vars --graph)'{-y,--yaml}'[use YAML format instead of JSON]'
+      ':host or group:->hosts'
     )
   ;;
   ansible-galaxy)
@@ -238,7 +243,7 @@ case $state in
   ;;
   galaxy)
     ign=''
-    gactions=( delete import info init install list login remove search setup )
+    gactions=( delete import info init install list remove search setup )
     case ${(j.:.)line[1,3]} in
       (role|collection):*:*)
         subcmd="${line[1]}-${line[2]}"
@@ -326,11 +331,6 @@ case $state in
            '--role-name=[specify name the role should have]:role'
         )
       ;;
-      role-login)
-	args+=(
-	  '--github-token=[identify with github token rather than username and password]'
-	)
-      ;;
       collection-build)
         args+=(
           '--output-path=[specify path in which the collection is built to]:path [.]:_directories'


                 reply	other threads:[~2021-04-19  9:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=12602-1618826308.769636@wv8v.ZfED.RB9V \
    --to=opk@zsh.org \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).