From 8126d8250b7c7782d2a391d5bb450e784a31e857 Mon Sep 17 00:00:00 2001 From: zhihui wu Date: Sun, 4 Mar 2018 16:23:58 +0800 Subject: generate inventory file and ssh configuration file Generate inventory file and ssh configuration file for VM. The default image is ubuntu 16.04. So the ansible user is ubuntu. Change-Id: Ie14ebcdcfbc24f045ffd32785eec07df5798c5fb Signed-off-by: zhihui wu --- resources/ansible_roles/openstack/templates/hosts.j2 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 resources/ansible_roles/openstack/templates/hosts.j2 (limited to 'resources/ansible_roles/openstack/templates/hosts.j2') diff --git a/resources/ansible_roles/openstack/templates/hosts.j2 b/resources/ansible_roles/openstack/templates/hosts.j2 new file mode 100644 index 00000000..6756d2a2 --- /dev/null +++ b/resources/ansible_roles/openstack/templates/hosts.j2 @@ -0,0 +1,17 @@ +localhost ansible_connection=local + +[SUT:children] +compute + +[node-groups:children] +compute + +[node-groups:vars] +ansible_ssh_common_args=-F ./ssh.cfg + +[compute] +{% for item in stack.stack.outputs %} +{% if item.output_key == 'instance_ip' %} +{{item.output_value}} +{% endif %} +{% endfor %} -- cgit 1.2.3-korg