Commit 1e704e5a authored by Pietsch, Martin's avatar Pietsch, Martin

remove container_used and container_host and add them to function

parent cf2a89de
......@@ -2,8 +2,6 @@
- include_tasks: configure.yml
- include_tasks: registercontainer.yml
- block:
- name: create directory for container
file:
......@@ -38,7 +36,7 @@
with_items: "{{ function_packages }}"
loop_control:
loop_var: jail
when: container_used == True
when: function_container_used == True
- name: install and configure native packages
include_role:
......
- name: check if jails are used
set_fact:
container_used: "{{ (container_used | default(False)) or (item.container | default(False)) }}"
with_items: "{{ function_packages | default([{'container': 'False'}]) }}"
- block:
- name: add container to inventory via sshjail connection
add_host:
......@@ -13,7 +8,7 @@
ansible_connection: "sshjail"
when: (item.container | default(False)) == True
with_items: "{{ function_packages }}"
when: ansible_connection == "ssh" and container_used == True
when: ansible_connection == "ssh" and function_container_used == True
- block:
- name: add container to inventory via jail connection
......@@ -24,8 +19,5 @@
ansible_host: "{{ item.name | replace('.', '_') }}"
when: (item.container | default(False)) == True
with_items: "{{ function_packages }}"
when: ansible_connection == "local" and container_used == True
when: ansible_connection == "local" and function_container_used == True
- set_fact:
container_host: "{{ inventory_hostname }}"
when: 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