# vim: set filetype=yaml.ansible : --- - name: Cargo source install helper when: - cargo_install_type == 'source' block: - name: Set build variables ansible.builtin.set_fact: git_path: "{{ d_tempdir.path }}/{{ name }}" git_repo: "{{ repo }}" git_depth: "{{ depth | default(1) }}" git_recursive: "{{ recursive | default(true) }}" git_version: "{{ version | default(omit) }}" - name: Fetch git repo ansible.builtin.include_tasks: file: helpers/git.yml - name: Build cargo release ansible.builtin.command: creates: "{{ bin_output }}" chdir: "{{ git_path }}" argv: "{{ [cargo, build] + cargo_build_flags }}" - name: Install cargo release block: - name: Install binary when: - bin_name is defined - bin_output is defined become: true ansible.builtin.copy: backup: false dest: "{{ install_prefix }}/bin/{{ bin_name }}" owner: root group: root mode: "0755" remote_src: true src: "{{ git_path }}/{{ bin_output }}"