i'm trying this in a playbook:
..
vars:
actionTodo: "{{ variable_actionTodo }}"
servicesList: "{{ variable_servicesList }}"
actionTodo_list: [start,stop,rstart,rstop,status,rstatus]
..
- name: manage services using systemctl
tags: manage services using systemctl
shell: systemctl {{actionTodo}} {{servicesList}}
with_items:
- "{{servicesList}}"
when: actionTodo != "" and servicesList != ""
ignore_errors: true
register: p2
- debug:
var: p2
i'd like to compare:
- actionTo value with value from actionTo_list
- and avoid printing "command not found" node without systemctl
--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/ebce1f66-f537-46dd-a810-9b9c64728f3b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.