From 07ba3e8e357856863aa84e2c7ac5ebdb67af7b9b Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 26 Feb 2025 07:53:51 -0700 Subject: [PATCH] Place commands which may be reused in other plybooks into more specific cmmands. --- tasks/workstation/linux/software/flutter.yml | 29 +++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/tasks/workstation/linux/software/flutter.yml b/tasks/workstation/linux/software/flutter.yml index ac8d1cf..ea6327d 100644 --- a/tasks/workstation/linux/software/flutter.yml +++ b/tasks/workstation/linux/software/flutter.yml @@ -3,17 +3,30 @@ ## Facts ## -- name: Workstation | Linux | Software | Flutter | Facts [1/2] +- name: Workstation | Linux | Software | Flutter | Facts [1/4] set_fact: flutter_url: "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.27.2-stable.tar.xz" flutter_download_file: "{{ user_user.home }}/Downloads/flutter.tar.xz" flutter_sdk_location: "{{ user_user.home }}/SDKs/Flutter" flutter_report: "{{ user_user.home }}/Reports/flutter.txt" -- name: Workstation | Linux | Software | Flutter | Facts [2/2] +- name: Workstation | Linux | Software | Flutter | Facts [2/4] set_fact: flutter_bin_location: "{{ flutter_sdk_location }}/flutter/bin" +- name: Workstation | Linux | Software | Flutter | Facts [3/4] + set_fact: + flutter: "{{ flutter_bin_location }}/flutter" + +- name: Workstation | Linux | Software | Flutter | Facts [3/3] + set_fact: + flutter_report_commands: + - "date > {{ flutter_report }}" + - "{{ flutter }} --disable-analytics >> {{ flutter_report }}" + - "date >> {{ flutter_report }}" + - "{{ flutter }} doctor -v >> {{ flutter_report }}" + - "date >> {{ flutter_report }}" + ## Checks ## - name: Workstation | Linux | Software | Flutter | Check SDK Exists @@ -60,9 +73,9 @@ package: name: - libc6:amd64 - - libstdc++6:amd64 + - libstdc++6 - lib32z1 - - libbz2-1.0:amd64 + - libbz2-1.0 state: present when: coding == true @@ -138,12 +151,8 @@ - name: Workstation | Linux | Software | Flutter | Doctor Report shell: "{{ item }}" - loop: - - "date > {{ flutter_report }}" - - "{{ flutter_bin_location }}/flutter --disable-analytics >> {{ flutter_report }}" - - "date >> {{ flutter_report }}" - - "{{ flutter_bin_location }}/flutter doctor -v >> {{ flutter_report }}" - - "date >> {{ flutter_report }}" + loop: "{{ flutter_report_commands }}" + become_user: "{{ user }}" when: coding == true ## Uninstall SDK ##