# \[newbie\] connecting to remote hosts and adding packages

**URL:** <https://forum.ansible.com/t/newbie-connecting-to-remote-hosts-and-adding-packages/23357>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [January 2, 2017, 4:52pm UTC](https://forum.ansible.com/t/newbie-connecting-to-remote-hosts-and-adding-packages/23357 "2017-01-02T16:52:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mario\_Giammarco](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@Mario\_Giammarco](https://forum.ansible.com/u/Mario_Giammarco)\
**Post date:** [January 2, 2017, 4:52pm UTC](https://forum.ansible.com/t/newbie-connecting-to-remote-hosts-and-adding-packages/23357/1 "2017-01-02T16:52:49Z")

</div>

Hello,  
I am trying ansible because it seems it is very simple in usage.  
I have the following use case:

- several ubuntu an debian servers (all permit login to non root users)
- user and password is different in each server
- I need to install a deb sources.list parametrized deb [http://xxxxxxx/yyyyyy/](http://xxxxxxx/yyyyyy/) $(lsb\_release -cs) main

It seems to me that this use case is very simple but I am confused:

1. I cannot find an easy way to manage the passwordless sudo use case
2. I cannot find how to parametrize sources.list

Thanks in advance for any suggestion!  
Mario

---

<div class="post-metadata">

**Author:** ![Johannes\_Kastl](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Johannes\_Kastl](https://forum.ansible.com/u/Johannes_Kastl)\
**Post date:** [January 3, 2017, 2:23pm UTC](https://forum.ansible.com/t/newbie-connecting-to-remote-hosts-and-adding-packages/23357/2 "2017-01-03T14:23:32Z")

</div>

Dear Mario,

> Hello,  
> I am trying ansible because it seems it is very simple in usage.

True. At least if you compare against the right thing...

> I have the following use case:  
> - several ubuntu an debian servers (all permit login to non root users)  
> - user and password is different in each server  
> - I need to install a deb sources.list parametrized deb  
> [http://xxxxxxx/yyyyyy/](http://xxxxxxx/yyyyyy/) $(lsb\_release -cs) main
> 
> It seems to me that this use case is very simple but I am confused:
> 
> 1) I cannot find an easy way to manage the passwordless sudo use case

I would do the following:

Set up ansible vault so you can store variables in encrypted files (I  
have a file that holds my vault-password, but you can also get  
prompted for it if you prefer)

Put user and password for the host foobar in  
host\_vars/foobar/encrypted.yml via "ansible-vault create ...":

--- snip ---
