# kubectl get nodes using context from a playbook

**URL:** <https://forum.ansible.com/t/kubectl-get-nodes-using-context-from-a-playbook/31164>\
**Category:** Ansible Project\
**Created:** [August 29, 2019, 10:17am UTC](https://forum.ansible.com/t/kubectl-get-nodes-using-context-from-a-playbook/31164 "2019-08-29T10:17:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![user\_user](https://avatars.discourse-cdn.com/v4/letter/u/c0e974/32.png) [@user\_user](https://forum.ansible.com/u/user_user)\
**Post date:** [August 29, 2019, 10:17am UTC](https://forum.ansible.com/t/kubectl-get-nodes-using-context-from-a-playbook/31164/1 "2019-08-29T10:17:20Z")

</div>

I’m trying to fetch nodes list via ansible playbook using a context name. but its not working

my playbook:

cat getnodes.yaml

---

<div class="post-metadata">

**Author:** ![user\_user](https://avatars.discourse-cdn.com/v4/letter/u/c0e974/32.png) [@user\_user](https://forum.ansible.com/u/user_user)\
**Post date:** [September 5, 2019, 7:52pm UTC](https://forum.ansible.com/t/kubectl-get-nodes-using-context-from-a-playbook/31164/2 "2019-09-05T19:52:31Z")

</div>

Any help on this.

I do have multiple clusters in config file. I need to either specify cluster name or context name and get the nodes list or to perform any activity on a particular cluster
