Commit 48d2188c authored by Spiros Koulouzis's avatar Spiros Koulouzis

added awx

parent eea641f2
This diff is collapsed.
......@@ -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
......@@ -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'
#
# 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)
# 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'
with open(input_tosca_file_path, 'r') as stream:
parsed_json_message = json.load(stream)
print(parsed_json_message)
if __name__ == '__main__':
......
version: '3'
services:
mongo:
image: mongo:4
ports:
- "27017:27017"
rabbit:
image: rabbitmq:3.8-management
ports:
- "5671-5672:5671-5672"
- "15672:15672"
- "4369:4369"
- "15671:15671"
postgres:
image: "postgres:9.6"
environment:
POSTGRES_USER: awx
POSTGRES_PASSWORD: awxpass
POSTGRES_DB: awx
rabbit:
image: rabbitmq:3.8-management
ports:
- "5671-5672:5671-5672"
- "15672:15672"
- "4369:4369"
- "15671:15671"
environment:
RABBITMQ_DEFAULT_VHOST: awx
memcached:
image: "memcached:alpine"
awx_web:
image: "geerlingguy/awx_web:latest"
#image: "ansible/awx_web:latest"
depends_on:
- rabbit
- 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
awx_task:
image: "geerlingguy/awx_task:latest"
#image: "ansible/awx_task:latest"
depends_on:
- rabbit
- 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
RABBITMQ_PORT: 5672
RABBITMQ_VHOST: awx
MEMCACHED_HOST: memcached
MEMCACHED_PORT: 11211
#mongo:
#image: mongo:4
#ports:
#- "27017:27017"
#jupyter:
#ports:
#- "30003:8888"
#image: jupyter/base-notebook
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:
RABBITMQ_HOST: rabbit
SURE_TOSCA_BASE_PATH: http://sure-tosca:8081/tosca-sure/1.0.0
#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"
deployer:
depends_on:
- rabbit
- sure-tosca
image: alogo53/deployer:3.0.0
environment:
RABBITMQ_HOST: rabbit
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"
#logspout:
#ports:
#- "30002:80"
#volumes:
#- /etc/hostname:/etc/host_hostname:ro
#- /var/run/docker.sock:/var/run/docker.sock
#environment:
#publish: "127.0.0.1:30002:80"
#image: gliderlabs/logspout:latest
#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:
#RABBITMQ_HOST: rabbit
#SURE_TOSCA_BASE_PATH: http://sure-tosca:8081/tosca-sure/1.0.0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment