Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
uphrh-sb-devops
Commits
be05234a
Unverified
Commit
be05234a
authored
2 years ago
by
Keshav Prasad
Browse files
Options
Download
Patches
Plain Diff
feat: upload plugins using existing roles
Signed-off-by:
Keshav Prasad
<
keshavprasadms@gmail.com
>
parent
3a25d5bd
upstream/release-5.1.0-vdn
login-changes
loginRegisterBtn
prasath-release-5.1.0
release-5.1.0
release-5.1.0-api
release-5.1.0-apiuat
release-5.1.0-bulk-enrol-unenrol
release-5.1.0-uat
release-5.1.0-uatLatest
release-5.1.0-uatapi
release-5.1.0-upsmf-prod
release-uat-nginx
revert-5-login-changes
release-5.1.0_RC3
release-5.1.0_RC2
release-5.1.0_RC1
1 merge request
!16
Release 5.1.0 api
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
ansible/deploy-plugins.yml
+7
-5
ansible/deploy-plugins.yml
ansible/roles/azure-cloud-storage/defaults/main.yml
+6
-1
ansible/roles/azure-cloud-storage/defaults/main.yml
ansible/roles/azure-cloud-storage/tasks/blob-delete-batch.yml
+1
-1
...ble/roles/azure-cloud-storage/tasks/blob-delete-batch.yml
ansible/roles/azure-cloud-storage/tasks/blob-upload-batch.yml
+2
-1
...ble/roles/azure-cloud-storage/tasks/blob-upload-batch.yml
ansible/roles/azure-cloud-storage/tasks/container-create.yml
+2
-2
ansible/roles/azure-cloud-storage/tasks/container-create.yml
pipelines/deploy/CEPlugins/Jenkinsfile
+1
-1
pipelines/deploy/CEPlugins/Jenkinsfile
with
19 additions
and
11 deletions
+19
-11
ansible/deploy-plugins.yml
+
7
−
5
View file @
be05234a
...
...
@@ -30,6 +30,7 @@
storage_account_sas_token
:
"
{{
azure_public_storage_account_sas
}}"
tags
:
-
always
no_log
:
True
-
block
:
-
name
:
delete files and folders from azure storage using azcopy
...
...
@@ -77,17 +78,18 @@
name
:
azure-cloud-storage
tasks_from
:
blob-delete-batch.yml
vars
:
blob_delete_pattern
:
"
content-plugins/{{
item
}}"
with_lines
:
"
cat
{{
plugin_list_to_delete_and_upload
}}
"
blob_delete_pattern
:
"
content-plugins/{{
item
}}
/*
"
with_lines
:
cat {{ plugin_list_to_delete_and_upload }}
-
name
:
upload batch of files to azure storage
include_role
:
name
:
azure-cloud-storage
tasks_from
:
blob-upload-batch.yml
vars
:
blob_container_folder_path
:
"
/content-plugins"
local_file_or_folder_path
:
"
{{
source_file
}}/{{
item
}}"
with_lines
:
"
cat
{{
plugin_list_to_delete_and_upload
}}"
blob_container_folder_path
:
"
/content-plugins/{{
item
}}"
local_file_or_folder_path
:
"
{{
source_folder
}}/{{
item
}}"
create_container
:
false
with_lines
:
cat {{ plugin_list_to_delete_and_upload }}
tags
:
-
plugins
when
:
cloud_service_provider == "azure"
...
...
This diff is collapsed.
Click to expand it.
ansible/roles/azure-cloud-storage/defaults/main.yml
+
6
−
1
View file @
be05234a
...
...
@@ -64,4 +64,9 @@ blob_container_folder_path: ""
# This variable affects only new containers and has no affect on a container if it already exists
# If the container already exists, the access level will not be changed
# You will need to change the access level from Azure portal or using az storage container set-permission command
container_public_access
:
"
"
\ No newline at end of file
container_public_access
:
"
"
# Create the container by default before running the specific azure tasks
# If we would like to skip container creation (in case of a looped execution), you can set this value to false
# in order to skip the task for every iteration
create_container
:
true
\ No newline at end of file
This diff is collapsed.
Click to expand it.
ansible/roles/azure-cloud-storage/tasks/blob-delete-batch.yml
+
1
−
1
View file @
be05234a
---
-
name
:
delete files and folders
from a
blob
container
recursively
-
name
:
delete files and folders
- deleting {{
blob
_
container
_name }}/{{ blob_delete_pattern }}
shell
:
"
az
storage
blob
delete-batch
--source
{{
blob_container_name
}}
--pattern
'{{
blob_delete_pattern
}}'
--account-name
{{
storage_account_name
}}
--account-key
{{
storage_account_key
}}"
async
:
3600
poll
:
10
\ No newline at end of file
This diff is collapsed.
Click to expand it.
ansible/roles/azure-cloud-storage/tasks/blob-upload-batch.yml
+
2
−
1
View file @
be05234a
...
...
@@ -3,8 +3,9 @@
include_role
:
name
:
azure-cloud-storage
tasks_from
:
container-create.yml
when
:
create_container is
true
-
name
:
upload files and folders
from a local directory to azure storage container
-
name
:
upload files and folders
- uploading {{ blob_container_name }}{{ blob_container_folder_path }}
shell
:
"
az
storage
blob
upload-batch
--destination
{{
blob_container_name
}}{{
blob_container_folder_path
}}
--source
{{
local_file_or_folder_path
}}
--account-name
{{
storage_account_name
}}
--account-key
{{
storage_account_key
}}"
async
:
3600
poll
:
10
\ No newline at end of file
This diff is collapsed.
Click to expand it.
ansible/roles/azure-cloud-storage/tasks/container-create.yml
+
2
−
2
View file @
be05234a
---
-
name
:
create container
in azure storage
if it doesn't exist
-
name
:
create container if it doesn't exist
shell
:
"
az
storage
container
create
--name
{{
blob_container_name
}}
--public-access
{{
container_public_access
}}
--account-name
{{
storage_account_name
}}
--account-key
{{
storage_account_key
}}"
when
:
storage_account_key | length >
0
-
name
:
create container
in azure storage
if it doesn't exist
-
name
:
create container if it doesn't exist
shell
:
"
az
storage
container
create
--name
{{
blob_container_name
}}
--public-access
{{
container_public_access
}}
--account-name
{{
storage_account_name
}}
--sas-token
'{{
storage_account_sas_token
}}'"
when
:
storage_account_sas_token | length > 0
\ No newline at end of file
This diff is collapsed.
Click to expand it.
pipelines/deploy/CEPlugins/Jenkinsfile
+
1
−
1
View file @
be05234a
...
...
@@ -34,7 +34,7 @@ node() {
mv content-plugins ansible
"""
ansiblePlaybook
=
"${currentWs}/ansible/deploy-plugins.yml"
ansibleExtraArgs
=
"--tags plugins --extra-vars \" source_f
ile
=${currentWs}/ansible/content-plugins plugin_list_to_delete_and_upload=${currentWs}/ansible/content-plugins/plugin
_list
_to_delete_and_upload.txt\" --vault-password-file /var/lib/jenkins/secrets/vault-pass"
ansibleExtraArgs
=
"--tags plugins --extra-vars \" source_f
older
=${currentWs}/ansible/content-plugins plugin_list_to_delete_and_upload=${currentWs}/ansible/content-plugins/plugin
s
_to_delete_and_upload.txt\" --vault-password-file /var/lib/jenkins/secrets/vault-pass"
values
.
put
(
'ansiblePlaybook'
,
ansiblePlaybook
)
values
.
put
(
'ansibleExtraArgs'
,
ansibleExtraArgs
)
println
values
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets