Skip to content

Commit 22721f8

Browse files
author
fabriziopandini
committed
1 parent 7bbae5b commit 22721f8

File tree

6 files changed

+14
-19
lines changed

6 files changed

+14
-19
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ ansible_group_vars_path and ansible_host_vars_path are not supported anymore
4040

4141
* Minor fix
4242

43-
# 0.8.0 (November 16, 2016)
43+
# 0.7.2 (November 16, 2016)
4444

4545
* issues #11 Allow management of Ansible vars for all hosts
4646
* issues #9 Create group_vars and host_vars directory only if necessary
4747

48+
* breacking change: custom group of groups all_groups:children removed. Insteal use all (automatically created by ansible)

doc/declarative.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -308,13 +308,13 @@ Group vars can be set to literal value or to Jinja2 value generators, that will
308308
- **context_vars** see below
309309
- **nodes**, list of nodes in the ansible_group to which the group_vars belong
310310

311-
Additionally it is possible to set variables for all groups/all hosts, by setting vars for the pre-defined `all_groups:children` group of groups:
311+
Additionally it is possible to set variables for all groups/all hosts, by setting vars for the pre-defined `all` group of groups:
312312

313313
```yaml
314314
kubernetes:
315315
...
316316
ansible_group_vars:
317-
all_groups:children:
317+
all:
318318
var1: ...
319319
...
320320
```
@@ -397,7 +397,7 @@ Context vars can be set to literal value or to Jinja2 value generators, that wil
397397

398398
> Context_vars generator are always executed before group_vars and host_vars generators; the resulting context, is given in input to group_vars and host_vars generators.
399399

400-
> In addition to context vars for groups, it is possible to create context_vars for all groups/all hosts, by setting vars for the pre-defined `all_groups:children` group of groups; in this case, intuitively, the list of nodes whitin the context contains all the nodes.
400+
> In addition to context vars for groups, it is possible to create context_vars for all groups/all hosts, by setting vars for the pre-defined `all` group of groups; in this case, intuitively, the list of nodes whitin the context contains all the nodes.
401401

402402
Then, you can use the above context var when generating group_vars for host vars.
403403

@@ -414,13 +414,13 @@ kubernetes:
414414
- kb8-minions
415415
416416
ansible_context_vars:
417-
all_groups:children:
417+
all:
418418
var0: "{{ nodes | count }}"
419419
kb8-master:
420420
var1: "{{ nodes | count }}"
421421
422422
ansible_group_vars:
423-
all_groups:children:
423+
all:
424424
var0_from_context: "{{ context['var0'] }}"
425425
kb8-master:
426426
var1_from_context: "{{ context['var1'] }}"
@@ -430,9 +430,7 @@ kubernetes:
430430

431431
A useful ansible inventory feature is [group of groups](http://docs.ansible.com/ansible/intro_inventory.html#hosts-and-groups).
432432

433-
By default vagrant-compose will generate a group named `[all_groups:children]` with all the ansible_groups defined in cluster configuration; however:
434-
- you cannot rename all_groups
435-
- you cannot exclude any ansible group from all_groups.
433+
By default ansible has a group named `[all]` with all nodes in the cluster.
436434

437435
If you need higher control on groups of groups you can simply add a new item to the variable `config.cluster.ansible_groups` before creating nodes.
438436

doc/programmatic.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -329,12 +329,12 @@ config.cluster.compose('test') do |c|
329329
end
330330
```
331331

332-
Additionally, it is possible to set variables for all groups/all hosts, by setting vars for the pre-defined `all_groups:children` group of groups:
332+
Additionally, it is possible to set variables for all groups/all hosts, by setting vars for the pre-defined `all` group of groups:
333333

334334
``` ruby
335335
config.cluster.compose('test') do |c|
336336
...
337-
c.ansible_group_vars['all_groups:childrenr'] = lambda { |context, nodes|
337+
c.ansible_group_vars['all'] = lambda { |context, nodes|
338338
return { 'var0' => nodes.length }
339339
}
340340
...
@@ -391,7 +391,7 @@ end
391391

392392
> Context_vars generator are always executed before group_vars and host_vars generators; the resulting context, is given in input to group_vars and host_vars generators.
393393
394-
> In addition to context vars for groups, it is possible to create context_vars for all groups/all hosts, by setting vars for the pre-defined `all_groups:children` group of groups; in this case, intuitively, the list of nodes whitin the context contains all the nodes.
394+
> In addition to context vars for groups, it is possible to create context_vars for all groups/all hosts, by setting vars for the pre-defined `all` group of groups; in this case, intuitively, the list of nodes whitin the context contains all the nodes.
395395
396396
Then, you can use the above context var when generating group_vars for nodes in the `consul-agent` group.
397397

@@ -411,9 +411,7 @@ end
411411
### Group of groups
412412
A useful ansible inventory feature is [group of groups](http://docs.ansible.com/ansible/intro_inventory.html#hosts-and-groups).
413413

414-
By default vagrant-compose will generate a group named `[all_groups:children]` with all the ansible_groups defined in cluster configuration; however:
415-
- you cannot rename all_groups
416-
- you cannot exclude any ansible group from all_groups.
414+
By default ansible has a group named `[all]` with all the nodes defined in cluster configuration.
417415

418416
If you need higher control on groups of groups you can simply add a new item to the variable `config.cluster.ansible_groups` before creating nodes.
419417

lib/vagrant/compose/config.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ def filterInventory(inventory)
6262
end
6363
end
6464

65-
ansible_groups['all_groups:children'] = ansible_groups.keys
66-
6765
return ansible_groups
6866
end
6967

lib/vagrant/compose/programmatic/cluster.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def compose
9494
ansible_groups[ansible_group] << node
9595
end
9696
end
97-
extended_ansible_groups = ansible_groups.merge({'all_groups:children' => nodes})
97+
extended_ansible_groups = ansible_groups.merge({'all' => nodes})
9898

9999
## Fase2: Configurazione provisioning del cluster via Ansible
100100
# Ogni nodo diventerà una vm su cui sarà fatto il provisioning, ovvero un host nell'inventory di ansible

lib/vagrant/compose/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Vagrant
22
module Compose
3-
VERSION = "0.8.0"
3+
VERSION = "0.7.2"
44
end
55
end

0 commit comments

Comments
 (0)