On Thursday, 22 February 2018 19.44.51 CET Jonathan Umpleby wrote:
> So, I'm new to ansible, and I'm hoping to find ways to meet a 
> customize-able CLI deployment scenario, where 99% of the commands are the 
> same across devices, but a handful will be unique.
> I was originally thinking about using a single response file would cover 
> the 99% (in my example I'm trying to configure multiple ProxySG's at the 
> same time).
> There are really two unknowns here (possibly 3).
> The first:
> I need to configure 3 network interfaces across 12 devices, all having a 
> different IP's and subnet masks.  Is there a way to sequentially pull this 
> from a list  lets say I have response files like:
> interface 1 list
> - coordinates to the first device
> etc
> interface 2 list
> or what would be the best way to accomplish this kind of task.

The information is a little sparse so it difficult to give a exact answer.
Ansible can loop over list and dictionary, and a combination of them.

Variables can be assign to host/device or to group, how you structure it 
depends on what you are trying to do.  

> The second:
> I'd like for obvious reasons, not store passwords in the playbook 
> If I added something like this: 
>  vars_prompt:
>   - name: 'enable_password'
>     prompt: 'Enable password:'
>     private: yes
>     encrypt: 'sha512_crypt'
>     confirm: yes
>     salt_size: 7
>   how would I use this in the script.  After I ssh into the device I would 
> need to type  a password for the enable which is what i'm trying to then 
> present through the script in a secure way.

vars_prompt create a variable with the name you give in name: that contain the 
You use is with {{ enable_password }} in Ansible.

Since you need to do this interactively you need to use the expect module.

Kai Stian Olstad

You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to