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
48d2188c
Commit
48d2188c
authored
Mar 07, 2020
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added awx
parent
eea641f2
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
142 additions
and
104 deletions
+142
-104
message_example_provisioned.json
TOSCA/message_example_provisioned.json
+1
-2
requirements.txt
deployer/requirements.txt
+3
-1
test_deployer.py
deployer/test/test_deployer.py
+23
-38
docker-compose.yml
docker-compose.yml
+115
-63
No files found.
TOSCA/message_example_provisioned.json
View file @
48d2188c
This diff is collapsed.
Click to expand it.
deployer/requirements.txt
View file @
48d2188c
...
...
@@ -6,4 +6,6 @@ wheel==0.34.1
pyyaml==5.3
tosca-parser ==1.7.0
matplotlib==3.1.2
ansible==2.9.4
ansible==2.9.6
`ansible-tower-cli==3.3.8
deployer/test/test_deployer.py
View file @
48d2188c
...
...
@@ -12,44 +12,29 @@ from service import k8s_service, tosca, ansible_service
class
TestDeployer
(
unittest
.
TestCase
):
def
test_parse_token
(
self
):
tosca_path
=
"../../ansible_playbooks/"
example_ansible_output_file_path
=
tosca_path
+
'/example_ansible_output.out'
if
not
os
.
path
.
exists
(
example_ansible_output_file_path
):
tosca_path
=
"../ansible_playbooks/"
example_ansible_output_file_path
=
tosca_path
+
'/example_ansible_output.out'
with
open
(
example_ansible_output_file_path
,
'r'
)
as
file
:
out
=
file
.
read
()
token
=
ansible_service
.
parse_dashboard_tokens
(
out
)
# def test(self):
# logger = logging.getLogger(__name__)
# tosca_path = "../../TOSCA/"
# input_tosca_file_path = tosca_path + '/message_example_provisioned.json'
# if not os.path.exists(input_tosca_file_path):
# tosca_path = "../TOSCA/"
# input_tosca_file_path = tosca_path + '/message_example_provisioned.json'
# def test_parse_token(self):
# tosca_path = "../../ansible_playbooks/"
# example_ansible_output_file_path = tosca_path + '/example_ansible_output.out'
# if not os.path.exists(example_ansible_output_file_path):
# tosca_path = "../ansible_playbooks/"
# example_ansible_output_file_path = tosca_path + '/example_ansible_output.out'
#
# with open(input_tosca_file_path, 'r') as stream:
# parsed_json_message = json.load(stream)
#
# # parsed_json_message = json.loads(message)
# owner = parsed_json_message['owner']
# tosca_file_name = 'tosca_template'
# tosca_template_json = parsed_json_message['toscaTemplate']
#
# interfaces = tosca.get_interfaces(tosca_template_json)
# tmp_path = tempfile.mkdtemp()
# vms = tosca.get_vms(tosca_template_json)
# inventory_path = ansible_service.write_inventory_file(tmp_path, vms)
# paths = ansible_service.write_playbooks_from_tosca_interface(interfaces, tmp_path)
# for playbook_path in paths:
# out,err = ansible_service.run(inventory_path,playbook_path)
# api_key, join_token, discovery_token_ca_cert_hash = ansible_service.parse_tokens(out.decode("utf-8"))
# ansible_playbook_path = k8s_service.write_ansible_k8s_files(tosca_template_json, tmp_path)
# out, err = ansible_service.run(inventory_path, ansible_playbook_path)
# with open(example_ansible_output_file_path, 'r') as file:
# out = file.read()
# token = ansible_service.parse_dashboard_tokens(out)
def
test
(
self
):
logger
=
logging
.
getLogger
(
__name__
)
tosca_path
=
"../../TOSCA/"
input_tosca_file_path
=
tosca_path
+
'/message_example_provisioned.json'
if
not
os
.
path
.
exists
(
input_tosca_file_path
):
tosca_path
=
"../TOSCA/"
input_tosca_file_path
=
tosca_path
+
'/message_example_provisioned.json'
with
open
(
input_tosca_file_path
,
'r'
)
as
stream
:
parsed_json_message
=
json
.
load
(
stream
)
print
(
parsed_json_message
)
if
__name__
==
'__main__'
:
...
...
docker-compose.yml
View file @
48d2188c
version
:
'
3'
services
:
mongo
:
image
:
mongo:4
ports
:
-
"
27017:27017"
postgres
:
image
:
"
postgres:9.6"
environment
:
POSTGRES_USER
:
awx
POSTGRES_PASSWORD
:
awxpass
POSTGRES_DB
:
awx
rabbit
:
image
:
rabbitmq:3.8-management
...
...
@@ -13,56 +14,107 @@ services:
-
"
15672:15672"
-
"
4369:4369"
-
"
15671:15671"
planner
:
depends_on
:
-
rabbit
-
sure-tosca
image
:
alogo53/planner:3.0.0
environment
:
RABBITMQ_HOST
:
rabbit
RABBITMQ_DEFAULT_VHOST
:
awx
provisioner
:
depends_on
:
-
rabbit
-
sure-tosca
image
:
alogo53/provisioner:3.0.0
environment
:
RABBITMQ_HOST
:
rabbit
SURE_TOSCA_BASE_PATH
:
http://sure-tosca:8081/tosca-sure/1.0.0
memcached
:
image
:
"
memcached:alpine"
deployer
:
awx_web
:
image
:
"
geerlingguy/awx_web:latest"
#image: "ansible/awx_web:latest"
depends_on
:
-
rabbit
-
sure-tosca
image
:
alogo53/deployer:3.0.0
-
memcached
-
postgres
ports
:
-
"
8052:8052"
#volumes:
#- /tmp/SECRET_KEY:/etc/tower/SECRET_KEY #echo aabbcc > /tmp/SECRET_KEY
user
:
root
environment
:
SECRET_KEY
:
aabbcc
DATABASE_USER
:
awx
DATABASE_PASSWORD
:
awxpass
DATABASE_NAME
:
awx
DATABASE_PORT
:
5432
DATABASE_HOST
:
postgres
RABBITMQ_USER
:
guest
RABBITMQ_PASSWORD
:
guest
RABBITMQ_HOST
:
rabbit
RABBITMQ_PORT
:
5672
RABBITMQ_VHOST
:
awx
MEMCACHED_HOST
:
memcached
MEMCACHED_PORT
:
11211
manager
:
awx_task
:
image
:
"
geerlingguy/awx_task:latest"
#image: "ansible/awx_task:latest"
depends_on
:
-
rabbit
-
mongo
-
sure-tosca
image
:
alogo53/manager:3.0.0
-
memcached
-
awx_web
-
postgres
#hostname: awx
user
:
root
environment
:
SECRET_KEY
:
aabbcc
DATABASE_USER
:
awx
DATABASE_PASSWORD
:
awxpass
DATABASE_NAME
:
awx
DATABASE_PORT
:
5432
DATABASE_HOST
:
postgres
RABBITMQ_USER
:
guest
RABBITMQ_PASSWORD
:
guest
RABBITMQ_HOST
:
rabbit
MONGO_HOST
:
mongo
SURE_TOSCA_BASE_PATH
:
http://sure-tosca:8081/tosca-sure/1.0.0
ports
:
-
"
30000:8080"
RABBITMQ_PORT
:
5672
RABBITMQ_VHOST
:
awx
MEMCACHED_HOST
:
memcached
MEMCACHED_PORT
:
11211
sure-tosca
:
image
:
alogo53/sure-tosca:3.0.0
ports
:
-
"
8081:8081"
#logspout:
#mongo:
#image: mongo:4
#ports:
#- "30002:80"
#volumes:
#- /etc/hostname:/etc/host_hostname:ro
#- /var/run/docker.sock:/var/run/docker.sock
#- "27017:27017"
#jupyter:
#ports:
#- "30003:8888"
#image: jupyter/base-notebook
#manager:
#depends_on:
#- rabbit
#- mongo
#- sure-tosca
#image: alogo53/manager:3.0.0
#environment:
#RABBITMQ_HOST: rabbit
#MONGO_HOST: mongo
#SURE_TOSCA_BASE_PATH: http://sure-tosca:8081/tosca-sure/1.0.0
#ports:
#- "30000:8080"
#sure-tosca:
#image: alogo53/sure-tosca:3.0.0
#ports:
#- "8081:8081"
#planner:
#depends_on:
#- rabbit
#- sure-tosca
#image: alogo53/planner:3.0.0
#environment:
#RABBITMQ_HOST: rabbit
#provisioner:
#depends_on:
#- rabbit
#- sure-tosca
#image: alogo53/provisioner:3.0.0
#environment:
#publish: "127.0.0.1:30002:80"
#image: gliderlabs/logspout:latest
#RABBITMQ_HOST: rabbit
#SURE_TOSCA_BASE_PATH: http://sure-tosca:8081/tosca-sure/1.0.0
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