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
13cd279f
Commit
13cd279f
authored
8 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
New script to update hosts file and ssh config locally
parent
8f48c0c0
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
+11
-11
11 additions, 11 deletions
tasks/main.yml
tasks/more.yml
+4
-4
4 additions, 4 deletions
tasks/more.yml
templates/etc_hosts
+2
-0
2 additions, 0 deletions
templates/etc_hosts
with
17 additions
and
15 deletions
tasks/main.yml
+
11
−
11
View file @
13cd279f
...
...
@@ -9,21 +9,21 @@
-
name
:
"
Create
The
/etc/hosts
File"
template
:
src
=
'etc_hosts'
dest
=
'/etc/hosts'
owner
=
'root'
group
=
'root'
mode
=
'644'
src
:
'
etc_hosts'
dest
:
'
/etc/hosts'
owner
:
'
root'
group
:
'
root'
mode
:
'
644'
-
name
:
"
Copy
SSH
Config
For
Server-To-Server
Communication
For
Admins"
template
:
src
=
'ssh_config'
dest
=
'/home/{{ item }}/.ssh/config'
owner
=
'{{ item }}'
group
=
'root'
mode
=
'644'
src
:
'
ssh_config'
dest
:
'
/home/{{
item
}}/.ssh/config'
owner
:
'
{{
item
}}'
group
:
'
root'
mode
:
'
644'
with_flattened
:
-
'
{{
admins
}}'
-
'
{{
admins
|default([])
}}'
-
'
{{
jailusers|default([])
}}'
-
name
:
"
Read
available
variable
cache
files"
...
...
This diff is collapsed.
Click to expand it.
tasks/more.yml
+
4
−
4
View file @
13cd279f
...
...
@@ -10,8 +10,8 @@
-
name
:
"
Add
Hosts
to
Hostfile"
lineinfile
:
dest
=
'/etc/hosts'
regexp
=
'.* {{ item }}$'
line
=
'{{ facts[item].static_ipv4 }} {{ item }}'
state
=
present
dest
:
'
/etc/hosts'
regexp
:
'
.*
{{
item
}}$'
line
:
'
{{
facts[item].static_ipv4
}}
{{
item
}}'
state
:
'
present
'
with_items
:
'
{{
facts
}}'
This diff is collapsed.
Click to expand it.
templates/etc_hosts
+
2
−
0
View file @
13cd279f
...
...
@@ -47,6 +47,8 @@ ff02::2 ip6-allrouters
{% endfor %}
{% for host in commonauth_extras|default([]) %}
{% if host.ip is defined %}
{{host.ip}}{% for name in host['names'] %} {{name}}{% endfor %}
{% endif %}
{% endfor %}
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