Commit 69e7f481 authored by Pietsch, Martin's avatar Pietsch, Martin

bugfix: register all hosts with container to inventory

parent c30a1d12
......@@ -2,22 +2,22 @@
- block:
- name: add container to inventory via sshjail connection
add_host:
name: "{{ inventory_hostname }}_{{ item.name | upper() }}"
ansible_ssh_host: "{{ item.name | replace('.', '_') }}@{{ansible_ssh_host}}"
name: "{{ item.0 }}_{{ item.1.name | upper() }}"
ansible_ssh_host: "{{ item.1.name | replace('.', '_') }}@{{ansible_ssh_host}}"
ansible_python_interpreter: "{{ ansible_python.executable }}"
ansible_connection: "sshjail"
when: (item.container | default(False)) == True
with_items: "{{ function_packages }}"
when: (item.1.container | default(False)) == True
loop: "{{ function_hosts | product(function_packages) | list }}"
when: ansible_connection == "ssh" and function_container_used == True
- block:
- name: add container to inventory via jail connection
add_host:
name: "{{ inventory_hostname }}_{{ item.name | upper() }}"
name: "{{ item.0 }}_{{ item.1.name | upper() }}"
ansible_python_interpreter: "{{ ansible_python.executable }}"
ansible_connection: "jail"
ansible_host: "{{ item.name | replace('.', '_') }}"
when: (item.container | default(False)) == True
with_items: "{{ function_packages }}"
ansible_host: "{{ item.1.name | replace('.', '_') }}"
when: (item.1.container | default(False)) == True
loop: "{{ function_hosts | product(function_packages) | list }}"
when: ansible_connection == "local" and function_container_used == 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