sucessfully ran single play but not when the play is part of a task in the pb

13 views
Skip to first unread message

Tony Wong

unread,
Jul 25, 2022, 8:23:26 PM7/25/22
to Ansible Project
I sucessully ran this play as a single play

---
- hosts: localhost
  name: test
  tasks:
  - name: run rke installer
    shell: 'rke up'
    args:
      chdir: "/home/rke"      
    become: yes
    become_user: "rke"
    delegate_to: localhost
    register: result
  - debug:
      msg: "{{ result }} "


however this did not work as part of a playbook task


Dick Visser

unread,
Jul 26, 2022, 1:28:48 AM7/26/22
to ansible...@googlegroups.com
I don't see a question?
And what do you mean by this playbook being pet of a playbook task?
Where is that code? Do we need to guess again what that looks like?

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/510cb366-ef13-4e1d-882e-f3db12d3ce7cn%40googlegroups.com.
--
Sent from Gmail Mobile

Walter Rowe

unread,
Aug 1, 2022, 8:33:13 AM8/1/22
to Ansible Project
Only this would need to be part of a larger playbook unless you want a playbook to have multiple PLAYS.

  - name: run rke installer 
    shell: 'rke up'
    args:
      chdir: "/home/rke"      
    become: yes
    become_user: "rke"
    delegate_to: localhost
    register: result
  - debug:
      msg: "{{ result }} "


Reply all
Reply to author
Forward
0 new messages