##### ISSUE TYPE
- Bug Report
##### COMPONENT NAME
ansible-core
##### ANSIBLE VERSION
```
ansible 2.6.1
config file = /etc/ansible/playbooks/example/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, Apr 11 2018, 07:36:10) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]
```
##### CONFIGURATION
```
ansible 2.6.1
config file = /etc/ansible/playbooks/example/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, Apr 11 2018, 07:36:10) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]
```
##### OS / ENVIRONMENT
CentOS Linux release 7.5.1804 (Core)
##### STEPS TO REPRODUCE
```yaml
roles/common/tasks/main.yml
---
- name: Reloading Service on {{ansible_hostname}}
service:
name: "{{ item }}"
state: reloaded
with_items: "{{ (servicename is defined) | ternary((servicename|default('')).split(','),[]) }}"
- name: checking the service status {{ansible_hostname}}
service:
name: "{{ item }}"
state: started
with_items: "{{ (servicename is defined) | ternary((servicename|default('')).split(','),[]) }}"
```
```YAML
playbook.yaml
- name: checking service is skipped by default
hosts: {{host}}
vars_files:
- /etc/ansible/inventories/group_vars/common.yaml
serial: 1
roles:
- common
```
#####Ansible command
ansible-playbook -vv --vault-id sre@/opt/sre -i /etc/ansible/inventories/funccphosts test.yml --extra-vars "host=node1,node2 servicename=[]"
##### EXPECTED RESULTS
I want to just skip the task of service if I am not passing any service name variable
##### ACTUAL RESULTS
```
TASK [common_role_ : Reloading Service on node1] ****************************
task path: /etc/ansible/roles/common_role_cow/tasks/main.yml:17
Thursday 27 September 2018 13:06:27 +0000 (0:00:00.529) 0:00:09.391 ****
fatal: [node1]: FAILED! =>
msg: '''list object'' has no attribute ''split'''
```
Is there anyone can help on this
--
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 post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/7c56eecb-0fb9-4bfc-8fa0-b8976d2ead6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jonathan lozada de la matta
AUTOMATION PRACTICE
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAFYJA%2B%2B_d5Qhi7uasGGYOKkbAErFgKBEPhsArRmuNi82T0-Z0Q%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAFYJA%2B%2B_d5Qhi7uasGGYOKkbAErFgKBEPhsArRmuNi82T0-Z0Q%40mail.gmail.com.
Guies is there any update or you need any information.
On Tue, 2 Oct 2018, 09:54 Kunalsing Thakur, <bits.ku...@gmail.com> wrote:
If you see my playbook and ansible-playbook its work fine for passing parameter but if I pass no value the task has to be skipped
On Tue, 2 Oct 2018, 09:18 Jonathan Lozada De La Matta, <jloz...@redhat.com> wrote:
what is exactly the issue? you need to provide more information.
On Mon, Oct 1, 2018 at 10:46 PM Kunalsing Thakur <bits.ku...@gmail.com> wrote:
Is there anyone can help on this
--
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-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/7c56eecb-0fb9-4bfc-8fa0-b8976d2ead6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
----Jonathan lozada de la matta
AUTOMATION PRACTICE
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-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.