Skip to content

Commit 98d6872

Browse files
committed
Test new group structure.
1 parent b0f2932 commit 98d6872

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

multinode-app.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,8 @@
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

outputs.tf

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,22 @@ resource "local_file" "admin_networks" {
5555

5656
output "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+
6774
resource "local_file" "openstack_inventory" {
6875
content = templatefile(
6976
"${path.module}/templates/openstack-inventory.tpl",

0 commit comments

Comments
 (0)