Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
commonconnect
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
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
Roles
commonconnect
Commits
507a7118
Commit
507a7118
authored
7 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
Improve commonauth_extra handling and introduce SSH proxy
parent
6fe04b81
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
tasks/main.yml
+2
-2
2 additions, 2 deletions
tasks/main.yml
templates/etc_hosts.jinja2
+3
-3
3 additions, 3 deletions
templates/etc_hosts.jinja2
templates/ssh_config.jinja2
+25
-0
25 additions, 0 deletions
templates/ssh_config.jinja2
with
30 additions
and
5 deletions
tasks/main.yml
+
2
−
2
View file @
507a7118
...
...
@@ -9,7 +9,7 @@
-
name
:
"
Create
The
/etc/hosts
File"
template
:
src
:
'
etc_hosts'
src
:
'
etc_hosts
.jinja2
'
dest
:
'
/etc/hosts'
owner
:
'
root'
group
:
'
root'
...
...
@@ -17,7 +17,7 @@
-
name
:
"
Copy
SSH
Config
For
Server-To-Server
Communication
For
Admins"
template
:
src
:
'
ssh_config'
src
:
'
ssh_config
.jinja2
'
dest
:
'
/home/{{
item
}}/.ssh/config'
owner
:
'
{{
item
}}'
group
:
'
root'
...
...
This diff is collapsed.
Click to expand it.
templates/etc_hosts
→
templates/etc_hosts
.jinja2
+
3
−
3
View file @
507a7118
...
...
@@ -46,9 +46,9 @@ ff02::2 ip6-allrouters
{% endif %}
{% endfor %}
{% for host in commonauth_extras|default([]) %}
{% for
hostname,
host in
(
commonauth_extras|default([])
).iteritems()
%}
{% if host.ip is defined %}
{{host.ip}}{% for name in host['names'] %} {{name}}{% endfor %}
{% endif %}
{{ host.ip }} {{ hostname }}{% for alias in host.aliases|default([]) %} {{ alias }}{% endfor %}
{% endif %}
{% endfor %}
This diff is collapsed.
Click to expand it.
templates/ssh_config
→
templates/ssh_config
.jinja2
+
25
−
0
View file @
507a7118
...
...
@@ -3,16 +3,23 @@
StrictHostKeyChecking no
ForwardAgent no
{%
for
host in commonauth_extras|default([]) %
}
{% if commonauth_extras is defined %}
{% for hostname, host in commonauth_extras.iteritems() %}
{% if host.ssh is defined or host.proxy is defined %}
Host {{ hostname }}{% for alias in host.aliases|default([]) %} {{ alias }}{% endfor %}
{% if host.ssh is defined %}
{%
for
name in host.names %
}
Host
{{
name
}}
{% for key, value in host.ssh.iteritems() %}
{{ key }} {{ value }}
{% endfor %}
{% endif %}
{% if host.proxy is defined %}
ForwardAgent yes
ProxyCommand /usr/bin/ssh {{ host.proxy }} /bin/nc %h %p
{% endif %}
{%
endfor
%
}
{% endif %}
{% endfor %}
{% endif %}
Host *
IdentityFile ~/.ssh/id_rsa
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