jeremiaswerner closed pull request #3406: Fix deployment of the CLI if edge is on a remote machine. URL: https://github.com/apache/incubator-openwhisk/pull/3406
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/roles/cli/tasks/deploy.yml b/ansible/roles/cli/tasks/deploy.yml index b2c51d1604..0e1fae5a85 100644 --- a/ansible/roles/cli/tasks/deploy.yml +++ b/ansible/roles/cli/tasks/deploy.yml @@ -10,33 +10,22 @@ state: directory become: "{{ openwhisk_cli.nginxdir.become }}" -- name: "Ensure OpenWhisk build directory exists (for temp archive work)" +- name: "Ensure temporary directory exists" file: - path: "{{ openwhisk_build_dir }}/{{ openwhisk_cli.archive_name }}" + path: "{{ nginx.confdir }}/cli_temp/{{ openwhisk_cli.archive_name }}" state: directory - mode: 0777 -# -# Why are we unarchiving into the build directory instead of directly into -# the Nginx config directory? Because the Nginx config directory is (by -# default) located in the /tmp/... directory tree, which has a sticky bit -# set. Said sticky bit creates no end of troubles for tar, so we're going -# to just avoid it entirely, rather than muck about with who's got which tar -# with which right tar options installed where. It makes for many more -# items in this ansible playbook than we'd hoped, but at least it's (fairly) -# straightforward. -# - name: "Download release archive to build directory ..." get_url: url: "{{ openwhisk_cli.remote.location }}/{{ openwhisk_cli.archive_name}}-{{ openwhisk_cli_tag }}-all.tgz" - dest: "{{ openwhisk_build_dir }}/{{ openwhisk_cli.archive_name }}.tgz" + dest: "{{ nginx.confdir }}/cli_temp/{{ openwhisk_cli.archive_name }}.tgz" headers: "{{ openwhisk_cli.remote.headers | default('') }}" when: openwhisk_cli.installation_mode == "remote" - name: "... or Copy release archive to build directory" copy: src: "{{ openwhisk_cli_home }}/release/{{ openwhisk_cli.archive_name}}-{{ openwhisk_cli_tag }}-all.tgz" - dest: "{{ openwhisk_build_dir }}/{{ openwhisk_cli.archive_name }}.tgz" + dest: "{{ nginx.confdir }}/cli_temp/{{ openwhisk_cli.archive_name }}.tgz" when: openwhisk_cli.installation_mode == "local" # @@ -45,23 +34,19 @@ # - name: "Expand the archive into the build directory" shell: > - tar zxf /{{ openwhisk_build_dir }}/{{ openwhisk_cli.archive_name }}.tgz - -C {{ openwhisk_build_dir }}/{{ openwhisk_cli.archive_name }}/ + tar zxf {{ nginx.confdir }}/cli_temp/{{ openwhisk_cli.archive_name }}.tgz + -C {{ nginx.confdir }}/cli_temp/{{ openwhisk_cli.archive_name }}/ +# Remote copy does not support recursive copy of directories. That's why I'm using the shell. - name: "Copy expanded archive to final configuration directory" - copy: - # WARNING: The trailing slash is significant, signalling to copy contents - src: "{{ openwhisk_build_dir }}/{{ openwhisk_cli.archive_name }}/" - dest: "{{ openwhisk_cli.nginxdir.name }}" + # WARNING: The trailing slash is significant, signalling to copy contents + shell: "cp -r {{ nginx.confdir }}/cli_temp/{{ openwhisk_cli.archive_name }}/* {{ openwhisk_cli.nginxdir.name }}" -- name: "Delete archive from build directory" +- name: "Delete temp directory" file: - path: "{{ item }}" + path: "{{ nginx.confdir }}/cli_temp" state: absent force: yes - with_items: - - "{{ openwhisk_build_dir }}/{{ openwhisk_cli.archive_name }}.tgz" - - "{{ openwhisk_build_dir }}/{{ openwhisk_cli.archive_name }}/" - name: "Generate a list of individual tarballs to expand" find: ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services