Var prompt use in awx tower

3,036 views
Skip to first unread message

samineni

unread,
Jun 21, 2018, 1:38:26 AM6/21/18
to awx-p...@googlegroups.com
Team,

I have wrote a playbook to create a users in server with vars_prompt, when i execute the playbook with  ansible cli it is working fine but the same was not working with awx tower.

what i  have to change in playbook  to get vars_prompt 


---
- hosts: all
  become_user: root
  become_method: sudo
  become: yes
  vars_prompt:
    - name: "user_name"
      prompt: "Enter user name to create"
      private: no
  tasks:
    - name: Creating user with above inputs
      user: name={{ user_name }}  comment="{{ user_name}} user" state=presen
​t​

Thanks & Regards.......?

Rajesh Samineni

Bill Nottingham

unread,
Jun 21, 2018, 11:06:22 AM6/21/18
to samineni, awx-p...@googlegroups.com
samineni (rajesh....@gmail.com) said:
> I have wrote a playbook to create a users in server with vars_prompt, when
> i execute the playbook with ansible cli it is working fine but the same
> was not working with awx tower.
>
> what i have to change in playbook to get vars_prompt

vars_prompt is not supported in AWX; all playbooks must run
non-interactively. Use a survey.

Bill

Rajesh Chowdary Samineni

unread,
Jun 22, 2018, 3:59:28 AM6/22/18
to AWX Project
Thanks for the info @Bill.
and what about local_action, for me plain Ansible cli successfully  executed playbook same not working with AWX.

Matthew Jones

unread,
Jun 27, 2018, 2:24:12 PM6/27/18
to rajesh....@gmail.com, AWX Project
You need to provide more information... how does it not work?

--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project...@googlegroups.com.
To post to this group, send email to awx-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/b0e9c6ad-efb9-41bd-84e1-a34bd28a22c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Matt Jones
Principal Software Engineer
Ansible Tower

Michael Wiley

unread,
Jul 11, 2018, 12:17:01 PM7/11/18
to AWX Project
The best way we've come up to work around this is:

---
- hosts: "{{ host_group }}"
connection: local
gather_facts: no
vars_prompt:
- name: "operator_id"
prompt: "Username"
private: no
when: operator_id is not defined
- name: "operator_passwd"
prompt: "Password"
when: operator_passwd is not defined
- name: "target_dc"
prompt: "Target DC"
when: target_dc is not defined
private: no


Adding the when statement allows us to either run by command ansible-playbook and receive the prompts or pass in the variables through extra-vars with a survey in AWX.
Reply all
Reply to author
Forward
0 new messages