Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cyber-sandbox-creator
Manage
Activity
Members
Labels
Plan
Issues
10
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
MUNI-KYPO-CSC
cyber-sandbox-creator
Commits
9f7f5b98
Commit
9f7f5b98
authored
3 years ago
by
Attila Farkas
Browse files
Options
Downloads
Patches
Plain Diff
Include Ansible requirements file if present
parent
89d45d39
No related branches found
No related tags found
1 merge request
!32
Version 2.0.0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cyber_sandbox_creator/input_parser/sandbox.py
+5
-0
5 additions, 0 deletions
cyber_sandbox_creator/input_parser/sandbox.py
cyber_sandbox_creator/vagrant_generator/vagrantfile.py
+9
-0
9 additions, 0 deletions
cyber_sandbox_creator/vagrant_generator/vagrantfile.py
with
14 additions
and
0 deletions
cyber_sandbox_creator/input_parser/sandbox.py
+
5
−
0
View file @
9f7f5b98
...
...
@@ -128,6 +128,11 @@ class Sandbox:
self
.
ansible_installed
:
bool
=
ansible_installed
self
.
verbose_ansible
:
bool
=
verbose_ansible
self
.
user_provisioning_dir
:
Optional
[
Path
]
=
user_provisioning_dir
if
self
.
user_provisioning_dir
is
not
None
:
self
.
include_requirements
:
bool
=
(
self
.
user_provisioning_dir
/
"
requirements.yml
"
).
is_file
()
else
:
self
.
include_requirements
:
bool
=
False
self
.
extra_vars
:
Optional
[
Path
]
=
extra_vars_file
self
.
config
:
Dict
=
Reader
.
open_yaml
(
configuration_path
)
self
.
flavors
:
List
[
Flavor
]
=
self
.
_load_flavors
(
flavors_path
)
...
...
This diff is collapsed.
Click to expand it.
cyber_sandbox_creator/vagrant_generator/vagrantfile.py
+
9
−
0
View file @
9f7f5b98
...
...
@@ -113,6 +113,15 @@ class Vagrantfile:
if
sandbox
.
extra_vars
is
not
None
:
attributes
.
append
(
String
(
"
extra_vars
"
,
sandbox
.
config
[
"
user_extra_vars
"
]))
if
sandbox
.
include_requirements
:
attributes
.
append
(
String
(
"
galaxy_role_file
"
,
"
provisioning/requirements.yml
"
))
attributes
.
append
(
String
(
"
galaxy_roles_path
"
,
"
provisioning/roles
"
))
attributes
.
append
(
String
(
"
galaxy_command
"
,
"
sudo ansible-galaxy install --role-file=
"
"
%{role_file} --roles-path=%{roles_path}
"
"
--force
"
))
return
attributes
@staticmethod
...
...
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