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
5d24c9c9
Commit
5d24c9c9
authored
5 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
ansible-playbooks/general#85 Linting
parent
3fe101ad
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
defaults/main.yml
+1
-1
1 addition, 1 deletion
defaults/main.yml
tasks/main.yml
+25
-22
25 additions, 22 deletions
tasks/main.yml
tasks/more.yml
+5
-5
5 additions, 5 deletions
tasks/more.yml
with
31 additions
and
28 deletions
defaults/main.yml
+
1
−
1
View file @
5d24c9c9
tunnel_user_name
:
'
systunnel
'
tunnel_user_name
:
systunnel
This diff is collapsed.
Click to expand it.
tasks/main.yml
+
25
−
22
View file @
5d24c9c9
---
# file: roles/commonconnect/tasks/main.yml
-
name
:
"
Common
Connect
Role
"
-
name
:
Common Connect Role
set_fact
:
role_commonconnect_started
:
true
tags
:
'
always'
tags
:
-
always
-
block
:
-
name
:
"
Create
The
/etc/hosts
File
"
-
name
:
Create The /etc/hosts File
template
:
src
:
'
etc_hosts.jinja2
'
dest
:
'
/etc/hosts
'
owner
:
'
root
'
group
:
'
root
'
mode
:
'
644
'
src
:
etc_hosts.jinja2
dest
:
/etc/hosts
owner
:
root
group
:
root
mode
:
644
-
name
:
"
Copy
SSH
Config
For
Server-To-Server
Communication
For
Admins
"
-
name
:
Copy SSH Config For Server-To-Server Communication For Admins
template
:
src
:
'
ssh_config.jinja2
'
dest
:
'
/home/{{
item
}}/.ssh/config
'
src
:
ssh_config.jinja2
dest
:
/home/{{ item }}/.ssh/config
owner
:
'
{{
item
}}'
group
:
'
root
'
mode
:
'
644
'
group
:
root
mode
:
644
with_flattened
:
-
'
{{
admins|default([])
}}
'
-
'
{{
jailusers|default([])
}}
'
-
{{
admins|default(
[]
)
}}
-
{{
jailusers|default(
[]
)
}}
-
block
:
-
name
:
"
Read
available
variable
cache
files
"
shell
:
'
ls
~/.ansible/hostvars
'
-
name
:
Read available variable cache files
shell
:
ls ~/.ansible/hostvars
become
:
no
register
:
variable_files
failed_when
:
false
changed_when
:
false
ignore_errors
:
true
tags
:
'
always'
tags
:
-
always
-
include_tasks
:
'
more.yml
'
-
include_tasks
:
more.yml
with_items
:
'
{{
variable_files.stdout_lines|default([])
}}'
loop_control
:
loop_var
:
inventory_name
when
:
lookup('pipe','hostname') == inventory_hostname
-
name
:
'
Remember
that
this
role
had
been
run
'
-
name
:
Remember that this role had been run
set_fact
:
role_commonconnect_completed
:
true
tags
:
'
always'
tags
:
-
always
when
:
'
"commonconnect"
not
in
excluded_roles
and
role_commonconnect_completed
is
not
defined
'
when
:
not excluded_roles or
"commonconnect" not in excluded_roles and role_commonconnect_completed is not defined
This diff is collapsed.
Click to expand it.
tasks/more.yml
+
5
−
5
View file @
5d24c9c9
---
# file: roles/commonconnect/tasks/more.yml
-
name
:
"
Set
facts
"
-
name
:
Set facts
set_fact
:
facts
:
"
{{
lookup('file','~/.ansible/hostvars/{{
inventory_name
}}')
|
from_json
}}"
-
name
:
"
Add
Hosts
to
Hostfile
"
-
name
:
Add Hosts to Hostfile
lineinfile
:
dest
:
'
/etc/hosts
'
regexp
:
'
.*
{{
item
}}$
'
dest
:
/etc/hosts
regexp
:
.* {{ item }}$
line
:
'
{{
facts[item].static_ipv4
}}
{{
item
}}'
state
:
'
present
'
state
:
present
with_items
:
'
{{
facts|default([])
}}'
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