Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
public-items
ansible-sc_pack-public
Commits
d93fed04
Commit
d93fed04
authored
Mar 01, 2021
by
Carlos Torres
Browse files
Adding shimmercat ports to create deployment
parent
78c9e291
Changes
6
Hide whitespace changes
Inline
Side-by-side
roles/create_deploy_type_cdn/tasks/credentials.yml
View file @
d93fed04
-
name
:
Create credentials without deploy
shell
:
source /srv/accelerator_client/venv/bin/activate && cloud_credentials --
install_dirs "{{ sc_pack_config_dir_list
}}" --auth-token {{ api_access_token }} --domains "{{ domains }}" --deployment-tags "{{ deployment_tags }}" --do-not-create-deployment
shell
:
source /srv/accelerator_client/venv/bin/activate && cloud_credentials --
shimmercat_listen_port "{{ item.value.https_port }}" --shimmercat_http2https_port "{{ item.value.http_port }}" --install_dirs "['/srv/inventory/{{ item.value.deployment_name
}}
']
" --auth-token {{ api_access_token }} --domains "{{ domains }}" --deployment-tags "{{ deployment_tags }}" --do-not-create-deployment
register
:
shell_result
args
:
executable
:
/bin/bash
when
:
"
False
==
create_deployment"
-
name
:
Create credentials with deploy
shell
:
source /srv/accelerator_client/venv/bin/activate && cloud_credentials --
install_dirs "{{ sc_pack_config_dir_list
}}" --auth-token {{ api_access_token }} --domains "{{ domains }}" --deployment-tags "{{ deployment_tags }}"
shell
:
source /srv/accelerator_client/venv/bin/activate && cloud_credentials
--
shimmercat_listen_port "{{ item.value.https_port }}" --shimmercat_http2https_port "{{ item.value.http_port }}" --install_dirs "['/srv/inventory/{{ item.value.deployment_name
}}
']
" --auth-token {{ api_access_token }} --domains "{{ domains }}" --deployment-tags "{{ deployment_tags }}"
register
:
shell_result
args
:
executable
:
/bin/bash
...
...
roles/create_deploy_type_cdn/tasks/main.yml
View file @
d93fed04
...
...
@@ -61,6 +61,7 @@
-
name
:
Create credentials
include_tasks
:
"
{{
role_path
}}/tasks/credentials.yml"
with_dict
:
"
{{
deployments
}}"
-
name
:
Create deployments
script
:
"
{{
role_path
}}/files/create_deploy.sh
{{
item.value.deployment_name
|
replace('.',
'_')
}}
{{installers_dir}}
{{item.value.install_dir}}
{{item.value.http_port}}
{{item.value.https_port}}
{{item.value.humanity_validator_port}}
{{
api_access_token
}}"
...
...
roles/create_deploys/tasks/credentials.yml
View file @
d93fed04
-
name
:
Create credentials without deploy
shell
:
source /srv/accelerator_client/venv/bin/activate && cloud_credentials --
install_dirs "{{ sc_pack_config_dir_list
}}" --auth-token {{ api_access_token }} --domains "{{ domains }}" --deployment-tags "{{ deployment_tags }}" --do-not-create-deployment
shell
:
source /srv/accelerator_client/venv/bin/activate && cloud_credentials --
shimmercat_listen_port "{{ item.value.https_port }}" --shimmercat_http2https_port "{{ item.value.http_port }}" --install_dirs "['/srv/inventory/{{ item.value.deployment_name
}}
']
" --auth-token {{ api_access_token }} --domains "{{ domains }}" --deployment-tags "{{ deployment_tags }}" --do-not-create-deployment
register
:
shell_result
args
:
executable
:
/bin/bash
when
:
"
False
==
create_deployment"
-
name
:
Create credentials with deploy
shell
:
source /srv/accelerator_client/venv/bin/activate && cloud_credentials --
install_dirs "{{ sc_pack_config_dir_list
}}" --auth-token {{ api_access_token }} --domains "{{ domains }}" --deployment-tags "{{ deployment_tags }}"
shell
:
source /srv/accelerator_client/venv/bin/activate && cloud_credentials
--
shimmercat_listen_port "{{ item.value.https_port }}" --shimmercat_http2https_port "{{ item.value.http_port }}" --install_dirs "['/srv/inventory/{{ item.value.deployment_name
}}
']
" --auth-token {{ api_access_token }} --domains "{{ domains }}" --deployment-tags "{{ deployment_tags }}"
register
:
shell_result
args
:
executable
:
/bin/bash
...
...
roles/create_deploys/tasks/main.yml
View file @
d93fed04
...
...
@@ -61,6 +61,7 @@
-
name
:
Create credentials
include_tasks
:
"
{{
role_path
}}/tasks/credentials.yml"
with_dict
:
"
{{
deployments
}}"
-
name
:
Create deployments
script
:
"
{{
role_path
}}/files/create_deploy.sh
{{
item.value.deployment_name
|
replace('.',
'_')
}}
{{installers_dir}}
{{item.value.install_dir}}
{{item.value.http_port}}
{{item.value.https_port}}
{{item.value.humanity_validator_port}}
{{
api_access_token
}}"
...
...
roles/install_accelerator_client/files/accelerator_client/py-src/cloud_credentials/accelerator_utils.py
View file @
d93fed04
...
...
@@ -8,7 +8,13 @@ from cloud_credentials import constants
DEFAULT_REQUESTS_TIMEOUT
=
300
# In seconds
def
create_deployment_site
(
authentication_token
,
description
=
''
,
tags
=
''
):
def
create_deployment_site
(
authentication_token
,
description
=
''
,
tags
=
''
,
shimmercat_listen_port
,
shimmercat_http2https_port
):
"""
Will create a deployment site instance on our cloud environment, and return
a dict with the:
...
...
@@ -19,13 +25,20 @@ def create_deployment_site(authentication_token, description='', tags=''):
:param authentication_token:
:param description:
:param tags:
:param shimmercat_listen_port:
:param shimmercat_http2https_port:
:return:
"""
url
=
'{}{}/'
.
format
(
constants
.
ACCELERATOR_BASE_URL
,
'deployment-site'
)
try
:
response
=
requests
.
post
(
url
,
json
=
{
'description'
:
description
,
'tags'
:
tags
},
json
=
{
'description'
:
description
,
'tags'
:
tags
,
'shimmercat_listen_port'
:
shimmercat_listen_port
,
'shimmercat_http2https_port'
:
shimmercat_http2https_port
},
headers
=
{
'Authorization'
:
'Token {}'
.
format
(
authentication_token
...
...
roles/install_accelerator_client/files/accelerator_client/py-src/cloud_credentials/entry_point.py
View file @
d93fed04
...
...
@@ -25,6 +25,22 @@ from cloud_credentials.accelerator_utils import (
def
main
():
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"-l"
,
"--shimmercat_listen_port"
,
dest
=
"shimmercat_listen_port"
,
help
=
(
"Shimmercat's listen port."
)
)
parser
.
add_argument
(
"-p"
,
"--shimmercat_http2https_port"
,
dest
=
"shimmercat_http2https_port"
,
help
=
(
"Shimmercat's http to https port."
)
)
parser
.
add_argument
(
"-i"
,
"--install_dirs"
,
...
...
@@ -104,8 +120,11 @@ def main():
deployment_data
=
create_deployment_site
(
auth_token
,
description
=
description
,
tags
=
deployment_tags
tags
=
deployment_tags
,
shimmercat_listen_port
,
shimmercat_http2https_port
)
###todo
if
deployment_data
and
'error'
not
in
deployment_data
.
keys
():
deployment_id
=
deployment_data
[
'deployment_id'
]
link_deployment_site_to_domains
(
...
...
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