# I'm trying to find a way to get variables from AWX API

**URL:** <https://forum.ansible.com/t/im-trying-to-find-a-way-to-get-variables-from-awx-api/32391>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [March 5, 2020, 1:32pm UTC](https://forum.ansible.com/t/im-trying-to-find-a-way-to-get-variables-from-awx-api/32391 "2020-03-05T13:32:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DeLoVaN](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@DeLoVaN](https://forum.ansible.com/u/DeLoVaN)\
**Post date:** [March 5, 2020, 1:32pm UTC](https://forum.ansible.com/t/im-trying-to-find-a-way-to-get-variables-from-awx-api/32391/1 "2020-03-05T13:32:13Z")

</div>

Hi there,

I use Gitlab-CI to build my products and they need a bunch of parameters to be built. I centralized them to Ansible (since many projects share the sames variables) and I am currently getting them by ssh-ing into a central server and generating a config file with an Ansible playbook, which then I can use to build.

This is a dirty way of doing it since by SSH, it exposed my whole Ansible project _and_ my vault key. I was wondering if AWX can help me in some way.

I found a clean way of doing it by using the AWX API to get host / groups variables. The issue is that it cannot read encrypted values with vault. This would make me expose my vault key to my Gitlab-CI, which I do not want to do. A dirtier solution would be to create a playbook which will print to stdout some json, so I can call API request to parse stdout by iterating on job\_events.

I’m not especially excited by this method. Do you guys have a better solution to lead me in the right way ? Thank you.
