Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CONF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UvA
CONF
Commits
28dfc109
Commit
28dfc109
authored
Aug 05, 2020
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed hyperleger inventory
parent
1e4a2672
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
ansible_service.py
deployer/service/ansible_service.py
+13
-4
No files found.
deployer/service/ansible_service.py
View file @
28dfc109
...
...
@@ -64,8 +64,11 @@ class AnsibleService:
if
application
.
name
==
'gluster_fs'
or
application
.
name
==
'glusterfs'
or
application
.
name
==
'tic'
:
arguments
=
'["-u","vm_user"]'
if
playbook_name
==
'013.mount_fs.yml'
:
master_ip
=
next
(
iter
(
inventory_dict
[
'all'
][
'children'
][
'swarm_manager_prime'
][
'hosts'
]))
for
vm
in
vms
:
attributes
=
vm
.
node_template
.
attributes
if
attributes
[
'role'
]
==
'master'
:
master_ip
=
attributes
[
'public_ip'
]
break
arguments
=
'["-u","vm_user","--extra-vars","gluster_cluster_host0=
\'
'
+
master_ip
+
'
\'
gluster_cluster_volume=
\'
gfs0
\'
"]'
task_id
=
self
.
run_task
(
name
,
project_id
,
key_id
,
git_url
,
inventory_id
,
playbook_name
,
environment_id
=
environment_id
,
arguments
=
arguments
)
...
...
@@ -173,22 +176,28 @@ class AnsibleService:
inventory
=
{}
all
=
{}
children
=
{}
gfs_count
=
1
for
vm
in
vms
:
attributes
=
vm
.
node_template
.
attributes
roles
=
[]
roles
.
append
(
'gfscluster'
)
public_ip
=
attributes
[
'public_ip'
]
vm_vars
=
{
'ansible_host'
:
public_ip
}
vm_vars
.
update
(
vars
)
for
role
in
roles
:
if
role
not
in
children
:
hosts
=
{}
else
:
hosts
=
children
[
role
]
if
'hosts'
in
hosts
:
hosts
[
'hosts'
][
public_ip
]
=
vars
hosts
[
'hosts'
][
'gfs'
+
str
(
gfs_count
)]
=
vm_vars
else
:
host
=
{}
host
[
public_ip
]
=
vars
host
[
'gfs'
+
str
(
gfs_count
)]
=
vm_
vars
hosts
[
'hosts'
]
=
host
gfs_count
+=
1
children
[
role
]
=
hosts
all
[
'children'
]
=
children
inventory
[
'all'
]
=
all
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment