# username and password

**URL:** <https://forum.ansible.com/t/username-and-password/24634>\
**Category:** Ansible Project\
**Created:** [June 2, 2017, 2:28pm UTC](https://forum.ansible.com/t/username-and-password/24634 "2017-06-02T14:28:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DOkuwa](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dokuwa/32/1471_2.png) [@DOkuwa](https://forum.ansible.com/u/DOkuwa)\
**Post date:** [June 2, 2017, 2:28pm UTC](https://forum.ansible.com/t/username-and-password/24634/1 "2017-06-02T14:28:45Z")

</div>

Hello ,

I am trying to define my username and password as variable in my playbook  
rather than run my playbook by adding the argument for username and password at the command line  
e.g ansible-playbook -u dokuwa1 -askpass apache.yml

this is my playbook

hosts: all  
tasks:

- name: install apache2  
apt: name=apache2 state=present update\_cache=yes

thanks
