Merge "Use subnodes groups for multinode roles and templates"

This commit is contained in:
Zuul 2018-10-17 17:53:55 +00:00 committed by Gerrit Code Review
commit 119d3c8b23
2 changed files with 5 additions and 5 deletions

View File

@ -144,7 +144,7 @@
retries: 100
delay: 5
with_items:
- "{{ hostvars.keys() }}"
- "{{ groups['subnodes'] }}"
# In case of blank centos image we need to create CI user and update inventory
- block:
@ -157,7 +157,7 @@
become: true
delegate_to: "{{ item}}"
with_items:
- "{{ hostvars.keys() }}"
- "{{ groups['subnodes'] }}"
- name: Setup keys
authorized_key:
@ -168,7 +168,7 @@
become_user: "{{ nodepool_user }}"
delegate_to: "{{ item}}"
with_items:
- "{{ hostvars.keys() }}"
- "{{ groups['subnodes'] }}"
- name: Allow user to have passwordless sudo
lineinfile:
@ -179,7 +179,7 @@
become: true
delegate_to: "{{ item}}"
with_items:
- "{{ hostvars.keys() }}"
- "{{ groups['subnodes'] }}"
- name: Add hosts
add_host:

View File

@ -1,4 +1,4 @@
{% for h in groups['all'] %}
{% for h in groups['subnodes'] %}
{{ h }} ansible_host={{ hostvars[h].ansible_host }} ansible_user={{ hostvars[h].ansible_user }} ansible_private_key_file={{ hostvars[h].ansible_private_key_file }}{% if hostvars[h].get('subnode_private_ip') %} subnode_private_ip={{ hostvars[h].subnode_private_ip }}{% endif %}{% if hostvars[h].get('subnode_public_ip') %} subnode_public_ip={{ hostvars[h].subnode_public_ip }}{% endif %}
{% endfor %}