Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HPCasCode
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
hpc-team
HPCasCode
Merge requests
!65
Add karaage version, fixed calculateEtcHosts
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Add karaage version, fixed calculateEtcHosts
AddKaraageCommitVersion
into
master
Overview
0
Commits
2
Pipelines
0
Changes
Closed
Jupiter Hu
requested to merge
AddKaraageCommitVersion
into
master
8 years ago
Overview
0
Commits
2
Pipelines
0
Changes
-
Expand
Fixed calculateEtcHosts and added karaage commit version
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
f686775f
2 commits,
8 years ago
+
9
−
11
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
Search (e.g. *.vue) (Ctrl+P)
roles/calculateEtcHosts/files/makehosts.py
+
8
−
7
Options
@@ -17,7 +17,7 @@ for group in d['groups'].keys():
i=0
for h in d['groups'][group]:
name = d['hostvars'][h]['ansible_hostname']
name = h
#
name = h
if not domain:
hosts[h] = [name]
else:
@@ -25,12 +25,13 @@ for group in d['groups'].keys():
for h in hosts.keys():
if d['hostvars'].has_key(h):
for addr in d['hostvars'][h]['ansible_all_ipv4_addresses']:
if "172.16.200" in addr:
string="%s"%addr
for name in hosts[h]:
string=string+" %s"%(name)
print string
string="%s"%(d['hostvars'][h]['ansible_eth0']['ipv4']['address'])
# for addr in d['hostvars'][h]['ansible_all_ipv4_addresses']:
# if "172.16.200" in addr:
# string="%s"%addr
for name in hosts[h]:
string=string+" %s"%(name)
print string
for h in hosts.keys():
if d['hostvars'].has_key(h):
Loading