(venv) simba@XXX:~/datacenter.aci-model$ ansible-playbook -i myinventory.yml myplaybook.yml -v
Using /home/simba/datacenter.aci-model/ansible.cfg as config file
PLAY [Deploy topology using ACI model] ***********************************************************************************************************************
TASK [datacenter.aci-model : include_tasks] ******************************************************************************************************************
included: /home/simba/datacenter.aci-model/tasks/my-test-yaml.yml for apic1
TASK [datacenter.aci-model : Create LLDP interface policies] *************************************************************************************************
failed: [apic1 -> localhost] (item={'access_policy_interface_policy_lldp_name': 'LLDP-ENABLE', 'access_policy_interface_policy_lldp_state': 'present', 'access_policy_interface_policy_lldp_receive_state': 'enabled', 'access_policy_interface_policy_lldp_transmit_state': 'enabled'}) => {"ansible_loop_var": "item", "changed": false, "item": {"access_policy_interface_policy_lldp_name": "LLDP-ENABLE", "access_policy_interface_policy_lldp_receive_state": "enabled", "access_policy_interface_policy_lldp_state": "present", "access_policy_interface_policy_lldp_transmit_state": "enabled"}, "msg": "argument 'receive_state' is of type <class 'str'> and we were unable to convert to bool: The value 'enabled' is not a valid boolean. Valid booleans include: 'off', 'y', 1, 0, 'on', 'f', '1', 't', 'yes', 'no', 'false', '0', 'true', 'n'"}
ok: [apic1 -> localhost] => (item={'access_policy_interface_policy_lldp_name': 'LLDP-DISABLE', 'access_policy_interface_policy_lldp_state': 'present', 'access_policy_interface_policy_lldp_receive_state': False, 'access_policy_interface_policy_lldp_transmit_state': False}) => {"ansible_loop_var": "item", "changed": false, "current": [{"lldpIfPol": {"attributes": {"adminRxSt": "disabled", "adminTxSt": "disabled", "annotation": "orchestrator:ansible", "descr": "", "dn": "uni/infra/lldpIfP-LLDP-DISABLE", "name": "LLDP-DISABLE", "nameAlias": "", "ownerKey": "", "ownerTag": "", "userdom": ":all:"}}}], "item": {"access_policy_interface_policy_lldp_name": "LLDP-DISABLE", "access_policy_interface_policy_lldp_receive_state": false, "access_policy_interface_policy_lldp_state": "present", "access_policy_interface_policy_lldp_transmit_state": false}, "mo": {"lldpIfPol": {"attributes": {"adminRxSt": "disabled", "adminTxSt": "disabled", "annotation": "orchestrator:ansible", "dn": "uni/infra/lldpIfP-LLDP-DISABLE", "name": "LLDP-DISABLE"}}}}
PLAY RECAP ***************************************************************************************************************************************************
apic1 : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
Need to update inventory file
- interface_policy_lldp:
- name: LLDP-ENABLE
state: present
receive_state: **on**
transmit_state: **on**
- name: LLDP-DISABLE
state: present
receive_state: **off**
transmit_state: **off**
After updating ...its work fine
(venv) simba@XXX:~/datacenter.aci-model$ ansible-playbook -i myinventory.yml myplaybook.yml -v
Using /home/simba/datacenter.aci-model/ansible.cfg as config file
PLAY [Deploy topology using ACI model] ***********************************************************************************************************************
TASK [datacenter.aci-model : include_tasks] ******************************************************************************************************************
included: /home/simba/datacenter.aci-model/tasks/my-test-yaml.yml for apic1
TASK [datacenter.aci-model : Create LLDP interface policies] *************************************************************************************************
ok: [apic1 -> localhost] => (item={'access_policy_interface_policy_lldp_name': 'LLDP-ENABLE', 'access_policy_interface_policy_lldp_state': 'present', 'access_policy_interface_policy_lldp_receive_state': True, 'access_policy_interface_policy_lldp_transmit_state': True}) => {"ansible_loop_var": "item", "changed": false, "current": [{"lldpIfPol": {"attributes": {"adminRxSt": "enabled", "adminTxSt": "enabled", "annotation": "orchestrator:ansible", "descr": "", "dn": "uni/infra/lldpIfP-LLDP-ENABLE", "name": "LLDP-ENABLE", "nameAlias": "", "ownerKey": "", "ownerTag": "", "userdom": ":all:"}}}], "item": {"access_policy_interface_policy_lldp_name": "LLDP-ENABLE", "access_policy_interface_policy_lldp_receive_state": true, "access_policy_interface_policy_lldp_state": "present", "access_policy_interface_policy_lldp_transmit_state": true}, "mo": {"lldpIfPol": {"attributes": {"adminRxSt": "enabled", "adminTxSt": "enabled", "annotation": "orchestrator:ansible", "dn": "uni/infra/lldpIfP-LLDP-ENABLE", "name": "LLDP-ENABLE"}}}}
ok: [apic1 -> localhost] => (item={'access_policy_interface_policy_lldp_name': 'LLDP-DISABLE', 'access_policy_interface_policy_lldp_state': 'present', 'access_policy_interface_policy_lldp_receive_state': False, 'access_policy_interface_policy_lldp_transmit_state': False}) => {"ansible_loop_var": "item", "changed": false, "current": [{"lldpIfPol": {"attributes": {"adminRxSt": "disabled", "adminTxSt": "disabled", "annotation": "orchestrator:ansible", "descr": "", "dn": "uni/infra/lldpIfP-LLDP-DISABLE", "name": "LLDP-DISABLE", "nameAlias": "", "ownerKey": "", "ownerTag": "", "userdom": ":all:"}}}], "item": {"access_policy_interface_policy_lldp_name": "LLDP-DISABLE", "access_policy_interface_policy_lldp_receive_state": false, "access_policy_interface_policy_lldp_state": "present", "access_policy_interface_policy_lldp_transmit_state": false}, "mo": {"lldpIfPol": {"attributes": {"adminRxSt": "disabled", "adminTxSt": "disabled", "annotation": "orchestrator:ansible", "dn": "uni/infra/lldpIfP-LLDP-DISABLE", "name": "LLDP-DISABLE"}}}}
PLAY RECAP ***************************************************************************************************************************************************
apic1 : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0