Hello,

I did param 2 entries in my hosts file:
[server]
localhost ansible_connection=local ansible_user=fvaltat  PARAM="['tomweb', 
'', 'Y','1']"
localhost ansible_connection=local ansible_user=fvaltat  PARAM="['openhr', 
'7.30.060', 'Y','2']"

In my playbook, I did set the hosts to server:
 - hosts: server
   become: False
   become_user: root
   roles:
   - listparam

and I do display the variables using the debug module in the main.yml of 
the listparam/tasks directory:
- debug: msg="DISPLAY variables from an array PARAM {{ param }} - 
param[0]-module {{ param[0] }} - param[1]-release {{ param[1] }}  - 
param[2]-tomtools {{ param[2] }} - param[3]-instance {{ param[3] }}"

But when I run the playbook, I only display the 2nd entry of the hosts 
file, why doesn't it run the playbook for the 1st entry ?
ansible-playbook -i ./hosts test_host.yml

PLAY [server] 
*******************************************************************

TASK [setup] 
*******************************************************************
ok: [localhost]


TASK [listparam : debug] 
*******************************************************
ok: [localhost] => {
    "msg": "DISPLAY variables from an array PARAM ['openhr', '7.30.060', 
'Y', '2'] - param[0]-module openhr - param[1]-release 7.30.060  - 
param[2]-tomtools Y - param[3]-instance 2"
}

I do expect to have this display too :
TASK [listparam : debug] 
*******************************************************
ok: [localhost] => {
    "msg": "DISPLAY variables from an array PARAM ['tomweb', '', 'Y', '1'] 
- param[0]-module tomweb - param[1]-release  - param[2]-tomtools Y - 
param[3]-instance 1"
}


-- 
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/2d1682ac-9163-40a0-a071-96c458eb17e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to