if i did not pass servicename while running ansible-playbook it will skipp 
the service task
and if i pass servicename the service will reloaded and check whether 
service is running or not.


On Thursday, September 27, 2018 at 10:46:55 PM UTC+5:30, Kunalsing Thakur 
wrote:
>
> Like this.
> - name: Reloading Service on {{ansible_fqdn}}
>   service:
>     name: "{{ item }}"
>     state: reloaded
>   with_items:  "{{ (notdefined is 
> defined)|ternary((notdefined|default('')).split(','),[]) }}"
>
> But i don't see servicename there.
>
> Can you just write one line of with_items so that i can understand what 
> you are saying.
>
> I want like this
> ansible-playbook -vv --vault-id sre@/opt/sre  -i 
> /etc/ansible/inventories/funccphosts test.yml --extra-vars 
> "host=node1,node2"
> If i pass service name like this
> ansible-playbook -vv --vault-id sre@/opt/sre  -i 
> /etc/ansible/inventories/funccphosts test.yml --extra-vars 
> "host=node1,node2 servicename=httpd"
> then it will work.
>
> Your help will be much appreciated looking for your reply.
>   
>
> On Thursday, September 27, 2018 at 10:31:08 PM UTC+5:30, Brian Coca wrote:
>>
>> just substitute for notdefined 
>>
>>
>>
>> -- 
>> ---------- 
>> Brian Coca 
>>
>

-- 
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/b9a28add-9187-4641-a95a-8cd20c8a54e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to