File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 4343 debug :
4444 msg : " {{ groups | to_yaml }}"
4545# when: cluster_state != "absent"
46+
47+ - hosts : multinode_ansible_control
48+ tasks :
49+ - name : Test hostname
50+ command : hostname
Original file line number Diff line number Diff line change @@ -55,15 +55,22 @@ resource "local_file" "admin_networks" {
5555
5656output "cluster_nodes" {
5757 description = " A list of the cluster nodes and their IP addresses which will be used by the Ansible inventory"
58- value = flatten ([
59- for node in openstack_compute_instance_v2 . compute : {
60- name = node . name
61- ip = node . access_ip_v4
62- groups = [" compute" ]
63- }
64- ])
58+ value = {
59+ name = openstack_compute_instance_v2.ansible_control.name
60+ ip = openstack_compute_instance_v2.ansible_control.access_ip_v4
61+ groups = [" multinode_ansible_control" ]
62+ }
6563}
6664
65+ # flatten([
66+ # for node in openstack_compute_instance_v2.compute: {
67+ # name = node.name
68+ # ip = node.access_ip_v4
69+ # groups = ["compute"]
70+ # }
71+ # ])
72+ # }
73+
6774resource "local_file" "openstack_inventory" {
6875 content = templatefile (
6976 " ${ path . module } /templates/openstack-inventory.tpl" ,
You can’t perform that action at this time.
0 commit comments