Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Simple Deploy- and Management
system.freebsd
Commits
21160dd8
Commit
21160dd8
authored
May 27, 2019
by
Pietsch, Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add loop_control to loops
parent
9182fb3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
tasks/registercontainer.yml
tasks/registercontainer.yml
+10
-6
No files found.
tasks/registercontainer.yml
View file @
21160dd8
...
...
@@ -2,22 +2,26 @@
-
block
:
-
name
:
add container to inventory via sshjail connection
add_host
:
name
:
"
{{
item.0
}}_{{
item
.1.name
|
upper()
}}"
ansible_ssh_host
:
"
{{
item
.1.name
|
replace('.',
'_')
}}@{{ansible_ssh_host}}"
name
:
"
{{
_container.0
}}_{{
_container
.1.name
|
upper()
}}"
ansible_ssh_host
:
"
{{
_container
.1.name
|
replace('.',
'_')
}}@{{ansible_ssh_host}}"
ansible_python_interpreter
:
"
{{
ansible_python.executable
}}"
ansible_connection
:
"
sshjail"
when
:
(
item
.1.container | default(False)) == True
when
:
(
_container
.1.container | default(False)) == True
loop
:
"
{{
function_hosts
|
product(function_packages)
|
list
}}"
loop_control
:
loop_var
:
_container
when
:
ansible_connection == "ssh" and function_container_used == True
-
block
:
-
name
:
add container to inventory via jail connection
add_host
:
name
:
"
{{
item.0
}}_{{
item
.1.name
|
upper()
}}"
name
:
"
{{
_container.0
}}_{{
_container
.1.name
|
upper()
}}"
ansible_python_interpreter
:
"
{{
ansible_python.executable
}}"
ansible_connection
:
"
jail"
ansible_host
:
"
{{
item
.1.name
|
replace('.',
'_')
}}"
when
:
(
item
.1.container | default(False)) == True
ansible_host
:
"
{{
_container
.1.name
|
replace('.',
'_')
}}"
when
:
(
_container
.1.container | default(False)) == True
loop
:
"
{{
function_hosts
|
product(function_packages)
|
list
}}"
loop_control
:
loop_var
:
_container
when
:
ansible_connection == "local" and function_container_used == True
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment