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
9b180a03
Commit
9b180a03
authored
5 years ago
by
Attila Farkas
Browse files
Options
Downloads
Patches
Plain Diff
add inventory path to vagrantfile
parent
c1f8cfaa
No related branches found
No related tags found
1 merge request
!7
Resolve Refactoring
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/ansible_generator.py
+0
-1
0 additions, 1 deletion
modules/ansible_generator.py
modules/vagrant_generator.py
+12
-2
12 additions, 2 deletions
modules/vagrant_generator.py
with
12 additions
and
3 deletions
modules/ansible_generator.py
+
0
−
1
View file @
9b180a03
...
...
@@ -14,7 +14,6 @@ def _create_inventory(input_definitions):
inventory_template
=
load_template
(
"
inventory
"
)
output
=
inventory_template
.
render
(
hosts
=
host_names
,
routers
=
router_names
)
generate_file
(
"
provisioning/inventory.ini
"
,
output
)
generate_file
(
"
base_provisioning/inventory.ini
"
,
output
)
def
generate_playbooks
(
input_definitions
,
flags
):
...
...
This diff is collapsed.
Click to expand it.
modules/vagrant_generator.py
+
12
−
2
View file @
9b180a03
...
...
@@ -6,6 +6,10 @@ from modules.file_manager import load_template, generate_file, open_yaml
VAGRANT_MAPPING
=
open_yaml
(
"
conf/vagrant_mapping.yml
"
)
VIRTUALBOX_MAPPING
=
open_yaml
(
"
conf/virtualbox_mapping.yml
"
)
BASE_PLAYBOOK
=
"
base_provisioning/device_configuration.yml
"
USER_PLAYBOOK
=
"
provisioning/playbook.yml
"
INVENTORY_FILE
=
"
provisioning/inventory.ini
"
def
_create_simple_attribute
(
key
,
value
,
attribute_type
):
...
...
@@ -56,6 +60,12 @@ def _create_ansible_commands(playbook_location, flags):
playbook
[
"
value
"
]
=
playbook_location
commands
.
append
(
playbook
)
inventory
=
dict
()
inventory
[
"
type
"
]
=
"
string
"
inventory
[
"
command
"
]
=
"
inventory_path
"
inventory
[
"
value
"
]
=
INVENTORY_FILE
commands
.
append
(
inventory
)
if
"
verbose_ansible
"
in
flags
and
flags
[
"
verbose_ansible
"
]:
verbosity
=
dict
()
verbosity
[
"
type
"
]
=
"
boolean
"
...
...
@@ -112,7 +122,7 @@ def _call_provisioner(flags):
config_playbook
[
"
provisioner
"
]
=
"
ansible
"
config_playbook
[
"
note
"
]
=
"
basic configuration of devices and networks
"
config_playbook
[
"
commands
"
]
=
_create_ansible_commands
(
"
base_provisioning/device_configuration.yml
"
,
flags
)
BASE_PLAYBOOK
,
flags
)
provisioner_calls
.
append
(
config_playbook
)
...
...
@@ -124,7 +134,7 @@ def _call_provisioner(flags):
user_playbook
[
"
provisioner
"
]
=
"
ansible
"
user_playbook
[
"
note
"
]
=
"
user configuration of devices
"
user_playbook
[
"
commands
"
]
=
_create_ansible_commands
(
"
base_provisioning/playbook.yml
"
,
flags
)
USER_PLAYBOOK
,
flags
)
provisioner_calls
.
append
(
user_playbook
)
...
...
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