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 ...@@ -6,4 +6,6 @@ wheel==0.34.1
pyyaml==5.3 pyyaml==5.3
tosca-parser ==1.7.0 tosca-parser ==1.7.0
matplotlib==3.1.2 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 ...@@ -12,44 +12,29 @@ from service import k8s_service, tosca, ansible_service
class TestDeployer(unittest.TestCase): class TestDeployer(unittest.TestCase):
def test_parse_token(self): # def test_parse_token(self):
tosca_path = "../../ansible_playbooks/" # tosca_path = "../../ansible_playbooks/"
example_ansible_output_file_path = tosca_path + '/example_ansible_output.out' # example_ansible_output_file_path = tosca_path + '/example_ansible_output.out'
if not os.path.exists(example_ansible_output_file_path): # if not os.path.exists(example_ansible_output_file_path):
tosca_path = "../ansible_playbooks/" # tosca_path = "../ansible_playbooks/"
example_ansible_output_file_path = tosca_path + '/example_ansible_output.out' # example_ansible_output_file_path = tosca_path + '/example_ansible_output.out'
#
with open(example_ansible_output_file_path, 'r') as file: # with open(example_ansible_output_file_path, 'r') as file:
out = file.read() # out = file.read()
token = ansible_service.parse_dashboard_tokens(out) # token = ansible_service.parse_dashboard_tokens(out)
# def test(self): def test(self):
# logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
# tosca_path = "../../TOSCA/" tosca_path = "../../TOSCA/"
# input_tosca_file_path = tosca_path + '/message_example_provisioned.json' input_tosca_file_path = tosca_path + '/message_example_provisioned.json'
# if not os.path.exists(input_tosca_file_path): if not os.path.exists(input_tosca_file_path):
# tosca_path = "../TOSCA/" tosca_path = "../TOSCA/"
# input_tosca_file_path = tosca_path + '/message_example_provisioned.json' input_tosca_file_path = tosca_path + '/message_example_provisioned.json'
#
# with open(input_tosca_file_path, 'r') as stream: with open(input_tosca_file_path, 'r') as stream:
# parsed_json_message = json.load(stream) parsed_json_message = json.load(stream)
#
# # parsed_json_message = json.loads(message) print(parsed_json_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)
if __name__ == '__main__': if __name__ == '__main__':
......
version: '3' version: '3'
services: services:
mongo: postgres:
image: mongo:4 image: "postgres:9.6"
ports: environment:
- "27017:27017" POSTGRES_USER: awx
POSTGRES_PASSWORD: awxpass
rabbit: POSTGRES_DB: awx
image: rabbitmq:3.8-management
ports: rabbit:
- "5671-5672:5671-5672" image: rabbitmq:3.8-management
- "15672:15672" ports:
- "4369:4369" - "5671-5672:5671-5672"
- "15671:15671" - "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: #manager:
depends_on: #depends_on:
- rabbit #- rabbit
- sure-tosca #- mongo
image: alogo53/provisioner:3.0.0 #- sure-tosca
environment: #image: alogo53/manager:3.0.0
RABBITMQ_HOST: rabbit #environment:
SURE_TOSCA_BASE_PATH: http://sure-tosca:8081/tosca-sure/1.0.0 #RABBITMQ_HOST: rabbit
#MONGO_HOST: mongo
#SURE_TOSCA_BASE_PATH: http://sure-tosca:8081/tosca-sure/1.0.0
#ports:
#- "30000:8080"
deployer: #sure-tosca:
depends_on: #image: alogo53/sure-tosca:3.0.0
- rabbit #ports:
- sure-tosca #- "8081:8081"
image: alogo53/deployer:3.0.0
environment: #planner:
RABBITMQ_HOST: rabbit #depends_on:
#- rabbit
manager: #- sure-tosca
depends_on: #image: alogo53/planner:3.0.0
- rabbit #environment:
- mongo #RABBITMQ_HOST: rabbit
- sure-tosca
image: alogo53/manager:3.0.0 #provisioner:
environment: #depends_on:
RABBITMQ_HOST: rabbit #- rabbit
MONGO_HOST: mongo #- sure-tosca
SURE_TOSCA_BASE_PATH: http://sure-tosca:8081/tosca-sure/1.0.0 #image: alogo53/provisioner:3.0.0
ports: #environment:
- "30000:8080" #RABBITMQ_HOST: rabbit
#SURE_TOSCA_BASE_PATH: http://sure-tosca:8081/tosca-sure/1.0.0
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
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