Commit 06c2e164 authored by Pietsch, Martin's avatar Pietsch, Martin

add containers of all hosts of a specific group to inventory

parent 15002c7a
......@@ -3,7 +3,8 @@
- name: add container to inventory via sshjail connection
add_host:
name: "{{ _contreg.0 }}_{{ _contreg.1.name | upper() }}"
ansible_ssh_host: "{{ _contreg.1.name | replace('.', '_') }}@{{ansible_ssh_host}}"
#ansible_ssh_host: "{{ _contreg.1.name | replace('.', '_') }}@{{ansible_ssh_host}}"
ansible_ssh_host: "{{ _contreg.1.name | replace('.', '_') }}@{{hostvars[_contreg.0].ansible_host | default(hostvars[_contreg.0] | get_host_control_ip()) }}"
ansible_python_interpreter: "{{ ansible_python.executable }}"
ansible_connection: "sshjail"
when: (_contreg.1.container | default(False)) == True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment