Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
salt
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3413a430
authored
Aug 11, 2015
by
Czémán Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add installer.sls genereator only for test
parent
70662566
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
123 additions
and
0 deletions
+123
-0
install.py
+123
-0
No files found.
install.py
0 → 100755
View file @
3413a430
#!/usr/bin/python
import
argparse
import
yaml
INSTALLER_SLS
=
"pillar/installer.sls"
def
generate_installer
(
deployment_type
,
deployment_mode
,
admin_user
,
admin_pass
,
amqp_host
,
graphite_host
,
nfs_enabled
,
nfs_server
,
nfs_network
,
storagedriver_queue_name
,
fwdriver_queue_name
,
fwdriver_gateway
,
fwdriwer_external_net
,
fwdriver_external_if
):
config
=
{
"user"
:
"cloud"
,
"proxy_secret"
:
"xooquageire7uX1"
,
"secret_key"
:
"Ga4aex3Eesohngo"
,
"timezone"
:
"Europe/Budapest"
,
"deployment_type"
:
deployment_type
,
"deployment_mode"
:
deployment_mode
,
"admin_user"
:
admin_user
,
"admin_pass"
:
admin_pass
,
"database"
:
{
"name"
:
"circle"
,
"user"
:
"circle"
,
"password"
:
"hoGei6paiN0ieda"
,
},
"amqp"
:
{
"user"
:
"cloud"
,
"password"
:
"password"
,
"host"
:
amqp_host
,
"port"
:
5672
,
"vhost"
:
"circle"
,
},
"graphite"
:
{
"user"
:
"monitor"
,
"password"
:
"monitor"
,
"host"
:
graphite_host
,
"port"
:
5672
,
"vhost"
:
"monitor"
,
"queue"
:
"monitor"
,
"secret_key"
:
"ahf2aim7ahLeo8n"
,
},
"cache"
:
"pylibmc://127.0.0.1:11211/"
,
"nfs"
:
{
"enabled"
:
nfs_enabled
,
"server"
:
nfs_server
,
"network"
:
nfs_network
,
"directory"
:
"/datastore"
},
"storagedriver"
:
{
"queue_name"
:
storagedriver_queue_name
},
"fwdriver"
:
{
"queue_name"
:
fwdriver_queue_name
,
"gateway"
:
fwdriver_gateway
,
"external_net"
:
fwdriwer_external_net
,
"external_if"
:
fwdriver_external_if
,
"trunk_if"
:
"linkb"
,
"management_if"
:
"ethy"
}
}
return
yaml
.
dump
(
config
,
default_flow_style
=
False
)
def
main
():
parser
=
argparse
.
ArgumentParser
(
description
=
'Generate installer.sls'
)
parser
.
add_argument
(
'-m'
,
'--mode'
,
dest
=
'mode'
,
required
=
True
,
help
=
'standalone or multinode'
)
parser
.
add_argument
(
'-i'
,
'--ip'
,
dest
=
'ip'
,
required
=
True
,
help
=
'IP addres of head machine'
)
parser
.
add_argument
(
'-q'
,
'--queue'
,
dest
=
'queue'
,
required
=
True
,
help
=
'host name of head machine'
)
args
=
parser
.
parse_args
()
config
=
generate_installer
(
deployment_type
=
"local"
,
deployment_mode
=
args
.
mode
,
admin_user
=
"admin"
,
admin_pass
=
"admin"
,
amqp_host
=
args
.
ip
,
graphite_host
=
args
.
ip
,
nfs_enabled
=
True
,
nfs_server
=
args
.
ip
,
nfs_network
=
args
.
ip
+
"/16"
,
storagedriver_queue_name
=
args
.
queue
,
fwdriver_queue_name
=
args
.
queue
,
fwdriver_gateway
=
"10.9.255.254"
,
fwdriwer_external_net
=
args
.
ip
+
"/16"
,
fwdriver_external_if
=
"eth0"
)
with
open
(
INSTALLER_SLS
,
"w"
)
as
f
:
f
.
write
(
config
)
if
__name__
==
"__main__"
:
main
()
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