csantanapr closed pull request #2969: Fix the permission issues when creating
the directories
URL: https://github.com/apache/incubator-openwhisk/pull/2969
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/ansible/group_vars/all b/ansible/group_vars/all
index c6ad149c4c..d25b84eb13 100644
--- a/ansible/group_vars/all
+++ b/ansible/group_vars/all
@@ -304,15 +304,13 @@ openwhisk_cli_tag: "{{ lookup('ini', 'git_tag
section=openwhisk-cli file={{ open
#
openwhisk_cli:
- installation_mode: local
+ installation_mode: "{{ cli_installation_mode | default('local') }}"
local:
location: "{{ openwhisk_cli_home }}/bin"
-
-# If you would like to use the remote mode, you can uncomment the following
section.
-# remote:
-# name: OpenWhisk_CLI
-# dest_name: OpenWhisk_CLI
-# location:
"https://github.com/apache/incubator-openwhisk-cli/releases/download/{{
openwhisk_cli_tag }}"
+ remote:
+ name: OpenWhisk_CLI
+ dest_name: OpenWhisk_CLI
+ location:
"https://github.com/apache/incubator-openwhisk-cli/releases/download/{{
openwhisk_cli_tag }}"
# The list of operating systems for which openwhisk cli binaries are
downloaded,
# if the installation_mode is remote.
diff --git a/ansible/roles/cli/tasks/cli_remote_mode.yml
b/ansible/roles/cli/tasks/cli_remote_mode.yml
index 3c3eb57419..063ac5144e 100644
--- a/ansible/roles/cli/tasks/cli_remote_mode.yml
+++ b/ansible/roles/cli/tasks/cli_remote_mode.yml
@@ -11,6 +11,13 @@
- name: "generate content.json locally for Nginx CLI directory"
local_action: shell "./createContentJson.sh" "{{ config_root_dir }}" "{{
openwhisk_cli_tag }}" "{{ cli_os | join(" ") }}" "{{
openwhisk_cli.remote.dest_name }}" chdir="{{ openwhisk_home
}}/ansible/roles/cli/files"
+- name: "ensure Nginx cli directory is writable"
+ file:
+ path: "{{ cli.nginxdir }}"
+ state: directory
+ mode: 0777
+ become: "{{ cli.dir.become }}"
+
- name: "copy the local content.json to the remote node"
copy: src={{ config_root_dir }}/content.json dest={{ cli.nginxdir }}/
diff --git a/ansible/roles/cli/tasks/copy_local_openwhisk_cli.yml
b/ansible/roles/cli/tasks/copy_local_openwhisk_cli.yml
index 3839ddf93a..50bce81e19 100644
--- a/ansible/roles/cli/tasks/copy_local_openwhisk_cli.yml
+++ b/ansible/roles/cli/tasks/copy_local_openwhisk_cli.yml
@@ -5,6 +5,13 @@
- local_action: stat path={{ openwhisk_cli.local.location }}/{{ item }}
register: binary_path
+- name: "ensure Nginx cli directory is writable"
+ file:
+ path: "{{ cli.nginxdir }}"
+ state: directory
+ mode: 0777
+ become: "{{ cli.dir.become }}"
+
- name: "copy the local binaries from a local directory to Nginx directory"
copy: src={{ openwhisk_cli.local.location }}/{{ item }} dest={{ cli.nginxdir
}}/
when: binary_path.stat.exists
diff --git a/ansible/roles/cli/tasks/download_openwhisk_cli.yml
b/ansible/roles/cli/tasks/download_openwhisk_cli.yml
index 7ff8852cc9..7ea209bedb 100644
--- a/ansible/roles/cli/tasks/download_openwhisk_cli.yml
+++ b/ansible/roles/cli/tasks/download_openwhisk_cli.yml
@@ -48,6 +48,8 @@
file:
path: "{{ cli.nginxdir }}/{{ os }}/{{ arc }}"
state: directory
+ mode: 0777
+ become: "{{ cli.dir.become }}"
- name: "download cli ({{ os }}) {{ arc }} to Nginx directory"
get_url:
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services