Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Ansible Framework Container
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ansible
Playbooks
Ansible Framework Container
Commits
07125dc0
Commit
07125dc0
authored
9 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#6
Use IdentitiesOnly and Pipelining only for inithost playbook
parent
43cab7e6
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
inithost.py
+20
-1
20 additions, 1 deletion
inithost.py
removehost.py
+1
-1
1 addition, 1 deletion
removehost.py
setup_local.yml
+0
-6
0 additions, 6 deletions
setup_local.yml
with
21 additions
and
8 deletions
inithost.py
+
20
−
1
View file @
07125dc0
...
...
@@ -42,7 +42,7 @@ if args.groups:
if
args
.
ip
:
extraVars
.
append
(
'
inithostip=
'
+
args
.
ip
)
cmd
=
[
path
+
'
ansible-playbook.
sh
'
,
'
inithost
'
,
'
--extra-vars=
'
+
'
'
.
join
(
extraVars
)]
cmd
=
[
path
+
'
ansible-playbook.
py
'
,
'
inithost
'
,
'
--extra-vars=
'
+
'
'
.
join
(
extraVars
)]
if
args
.
key
:
cmd
.
append
(
'
--private-key=
'
+
args
.
key
)
...
...
@@ -52,4 +52,23 @@ else:
for
extra
in
extras
:
cmd
.
append
(
extra
)
def
setEnvironment
(
key
,
value
):
if
key
in
os
.
environ
:
default
=
os
.
environ
[
key
]
else
:
default
=
None
if
value
:
os
.
environ
[
key
]
=
value
else
:
del
os
.
environ
[
key
]
return
default
# Set the ssh arguments so that IdentitiesOnly is being set to true
originalAnsibleSshArgs
=
setEnvironment
(
'
ANSIBLE_SSH_ARGS
'
,
'
-o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s
'
)
originalAnsibleSshPipelining
=
setEnvironment
(
'
ANSIBLE_SSH_PIPELINING
'
,
'
False
'
)
call
(
cmd
)
# reset the ssh arguments
setEnvironment
(
'
ANSIBLE_SSH_ARGS
'
,
originalAnsibleSshArgs
)
setEnvironment
(
'
ANSIBLE_SSH_PIPELINING
'
,
originalAnsibleSshPipelining
)
This diff is collapsed.
Click to expand it.
removehost.py
+
1
−
1
View file @
07125dc0
...
...
@@ -24,7 +24,7 @@ extraVars = ['host=' + args.host]
if
args
.
cloud
:
extraVars
.
append
(
'
cloud=
'
+
args
.
cloud
)
cmd
=
[
path
+
'
ansible-playbook.
sh
'
,
'
removehost
'
,
'
--extra-vars=
'
+
'
'
.
join
(
extraVars
)]
cmd
=
[
path
+
'
ansible-playbook.
py
'
,
'
removehost
'
,
'
--extra-vars=
'
+
'
'
.
join
(
extraVars
)]
for
extra
in
extras
:
cmd
.
append
(
extra
)
...
...
This diff is collapsed.
Click to expand it.
setup_local.yml
+
0
−
6
View file @
07125dc0
...
...
@@ -75,12 +75,6 @@
-
option
:
"
scp_if_ssh"
value
:
"
True"
section
:
"
ssh_connection"
-
option
:
"
ssh_args"
value
:
"
-o
IdentitiesOnly=yes"
section
:
"
ssh_connection"
-
option
:
"
pipelining"
value
:
"
False"
section
:
"
ssh_connection"
-
name
:
"
Add
vault
to
ansible
configuration"
ini_file
:
dest
:
"
~/.ansible.cfg"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment