-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: make sure binary install dir exists #423
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,6 +104,24 @@ | |
check_mode: false | ||
when: __common_binary_basename is search('\.zip$|\.tar\.gz$') | ||
|
||
- name: "Check existence of binary install dir" | ||
ansible.builtin.stat: | ||
path: "{{ _common_binary_install_dir }}" | ||
register: __common_binary_install_dir | ||
|
||
- name: "Make sure binary install dir exists" | ||
ansible.builtin.file: | ||
path: "{{ _common_binary_install_dir }}" | ||
mode: 0755 | ||
owner: root | ||
group: root | ||
Comment on lines
+115
to
+117
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure we should be explicitly changing these permissions, given this is For example, if this is a symlink, I'm pretty sure this will break the system. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The mode/owner has to be set because of https://nvd.nist.gov/vuln/detail/CVE-2020-1736 |
||
become: true | ||
tags: | ||
- "{{ ansible_parent_role_names | first | regex_replace(ansible_collection_name ~ '.', '') }}" | ||
- install | ||
- "{{ ansible_parent_role_names | first | regex_replace(ansible_collection_name ~ '.', '') }}_install" | ||
when: not __common_binary_install_dir.stat.exists | ||
|
||
- name: "Propagate binaries" | ||
ansible.builtin.copy: | ||
src: "{{ _common_local_cache_path }}/{{ item }}" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote this with reference to below format:
ansible/roles/systemd_exporter/tasks/preflight.yml
Lines 42 to 50 in f3514a9