Some quick background. I'm using ansible to automate setup of development 
environments for new projects. These are active development environments, 
not freshly provisioned machines, so some challenges come with the 
territory--in particular there are times when I would use a template to 
configure a new machine, but in an active dev environment I have to modify 
existing config files.

In one case I am configuring the ~/.ssh/config file to make it possible to 
SSH in to a vagrant box using a regular 'ssh vagrantguest' by taking the 
resulting config block from 'vagrant ssh-config'. This is a multi-line 
block. I have a playbook that does something like this:

- name: Retrieve ssh config from vagrant
  shell: vagrant ssh-config --host vagrantguest chdir={{ project_path }}
  changed_when: False
  register: vagrant_ssh_config

- name: Add ssh config to ~/.ssh/config
  lineinfile: path=~/.ssh/config line={{ vagrant_ssh_config.stdout }} regexp
="^Host vagrantguest\n.*\n"

The variable, vagrant_ssh_config.stdout is added to the file but is 
surrounded in single-quotes. Is this a bug or expected behavior? Is there a 
way to remove these quotes? Or is there a better solution to this 
altogether?

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c76a55c1-7f04-45f0-ab24-6a167624bf05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to