Skip to content

Commit

Permalink
Better management of inventory to pick up tags
Browse files Browse the repository at this point in the history
Added a meta task to rebuild inventory. This causes the ec2.py script to
be run again and pick up the tags for the recently provisioned ec2
instances, so that the tags can be used as variables later in
plays/tasks.
  • Loading branch information
skoranda committed Nov 9, 2019
1 parent 42233fb commit 00d0782
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions ec2.ini
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ cache_path = ~/.ansible/tmp
# seconds, a new API call will be made, and the cache file will be updated.
# To disable the cache, set this value to 0
#cache_max_age = 300
cache_max_age = 0

# Organize groups into a nested/hierarchy instead of a flat namespace.
nested_groups = False
Expand Down
5 changes: 4 additions & 1 deletion training_nodes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,11 @@
overwrite: yes
wait: no
loop: "{{ training_nodes.results }}"

- name: Refresh inventory to pick up ec2 tags
meta: refresh_inventory

- hosts: ssh_training_node_hosts
- hosts: tag_role_comanage_registry
become: yes
gather_facts: True
strategy: free
Expand Down

0 comments on commit 00d0782

Please sign in to comment.