Ansible: How to print/echo/debug variable name while in loop? Announcing the arrival of Valued...

Married in secret, can marital status in passport be changed at a later date?

Are Flameskulls resistant to magical piercing damage?

How to break 信じようとしていただけかも知れない into separate parts?

What is the evidence that custom checks in Northern Ireland are going to result in violence?

Why is ArcGIS Pro not symbolizing my entire range of values?

Does the Pact of the Blade warlock feature allow me to customize the properties of the pact weapon I create?

What kind of capacitor is this in the image?

What is the ongoing value of the Kanban board to the developers as opposed to management

How to charge percentage of transaction cost?

Why did Europeans not widely domesticate foxes?

How do I deal with an erroneously large refund?

Coin Game with infinite paradox

Does GDPR cover the collection of data by websites that crawl the web and resell user data

Can 'non' with gerundive mean both lack of obligation and negative obligation?

Assertions In A Mock Callout Test

Recursive calls to a function - why is the address of the parameter passed to it lowering with each call?

Unix AIX passing variable and arguments to expect and spawn

Can this water damage be explained by lack of gutters and grading issues?

BV functions and wave equation

Why do C and C++ allow the expression (int) + 4*5?

Why isn't everyone flabbergasted about Bran's "gift"?

Why are two-digit numbers in Jonathan Swift's "Gulliver's Travels" (1726) written in "German style"?

How can I introduce the names of fantasy creatures to the reader?

Has a Nobel Peace laureate ever been accused of war crimes?



Ansible: How to print/echo/debug variable name while in loop?



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Come Celebrate our 10 Year Anniversary!How to see stdout of ansible commands?Can't install PM2 services via Ansible on an Ubuntu EC2 instanceansible print debug msg variableansible run global variableAnsible list variable undefinedPrint Ansible debug output without quotes/escapesAnsible Variable above hostsAnsible multiline results and loopUsing Ansible, how can I take actions on each file in a specific location?Ansible: Print debug msg with different color





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I have this inside setup/tasks/apps.yml:



- name: Mac App Store | Install apps.
shell: mas list | grep {{ item.id }} || mas install {{ item.id }}
with_items: "{{ mac_store_apps }}"
register: result
changed_when: result.stdout.find('Installed') != -1


I know I can use:



      loop_control:
label: '{{ item.name }}'


But I want to print something like "Attempting to Install {{ item.name }}" before each execution. How can that be done?









share







New contributor




zerohedge is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



























    0















    I have this inside setup/tasks/apps.yml:



    - name: Mac App Store | Install apps.
    shell: mas list | grep {{ item.id }} || mas install {{ item.id }}
    with_items: "{{ mac_store_apps }}"
    register: result
    changed_when: result.stdout.find('Installed') != -1


    I know I can use:



          loop_control:
    label: '{{ item.name }}'


    But I want to print something like "Attempting to Install {{ item.name }}" before each execution. How can that be done?









    share







    New contributor




    zerohedge is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I have this inside setup/tasks/apps.yml:



      - name: Mac App Store | Install apps.
      shell: mas list | grep {{ item.id }} || mas install {{ item.id }}
      with_items: "{{ mac_store_apps }}"
      register: result
      changed_when: result.stdout.find('Installed') != -1


      I know I can use:



            loop_control:
      label: '{{ item.name }}'


      But I want to print something like "Attempting to Install {{ item.name }}" before each execution. How can that be done?









      share







      New contributor




      zerohedge is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I have this inside setup/tasks/apps.yml:



      - name: Mac App Store | Install apps.
      shell: mas list | grep {{ item.id }} || mas install {{ item.id }}
      with_items: "{{ mac_store_apps }}"
      register: result
      changed_when: result.stdout.find('Installed') != -1


      I know I can use:



            loop_control:
      label: '{{ item.name }}'


      But I want to print something like "Attempting to Install {{ item.name }}" before each execution. How can that be done?







      ansible ansible-playbook





      share







      New contributor




      zerohedge is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      zerohedge is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      zerohedge is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 2 mins ago









      zerohedgezerohedge

      101




      101




      New contributor




      zerohedge is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      zerohedge is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      zerohedge is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "2"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          zerohedge is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f964128%2fansible-how-to-print-echo-debug-variable-name-while-in-loop%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          zerohedge is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          zerohedge is a new contributor. Be nice, and check out our Code of Conduct.













          zerohedge is a new contributor. Be nice, and check out our Code of Conduct.












          zerohedge is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Server Fault!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f964128%2fansible-how-to-print-echo-debug-variable-name-while-in-loop%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          117736 Шеррод Примітки | Див. також | Посилання | Навігаційне...

          As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

          Маріан Котлеба Зміст Життєпис | Політичні погляди |...