Skip to content

Commit

Permalink
fix: another refactor mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
codedwrench committed Nov 9, 2023
1 parent 9419a00 commit 2df6da4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Resources/Ansible_Windows/install_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@

- name: Check right version installed
ansible.windows.win_shell: Select-String -Path "{{ drive }}:\{{ install_dir }}\{{ runner_folder }}\version.txt" -Pattern "{{ runner_version }}"
when: stat_version.stat.exists
when: not stat_version.stat.exists
changed_when: false
register: installed_packages

- name: Download the runner
ansible.windows.win_get_url:
dest: "{{ drive }}:\\{{ install_dir }}\\runner.zip"
url: https://github.com/actions/runner/releases/download/v{{ runner_version }}/actions-runner-win-x64-{{ runner_version }}.zip
when: (stat_version.stat.exists) or (installed_packages.stdout is defined and installed_packages.stdout == "")
when: (not stat_version.stat.exists) or (installed_packages.stdout is defined and installed_packages.stdout == "")
register: runner_download_result

- name: Unzip Runner
Expand All @@ -50,7 +50,7 @@
become_user: "{{ user }}"
become_method: ansible.builtin.runas
register: register_output
when: (stat_version.stat.exists) and (runner_download_result.msg is defined and runner_download_result.msg == "OK")
when: (not stat_version.stat.exists) and (runner_download_result.msg is defined and runner_download_result.msg == "OK")

- name: Set version, only if registration went through, so this script can be called multiple times
community.windows.win_lineinfile:
Expand All @@ -59,4 +59,4 @@
line: "{{ runner_version }}"
state: present
create: true
when: (stat_version.stat.exists) or (register_output.rc is defined and register_output.rc == 0)
when: (not stat_version.stat.exists) or (register_output.rc is defined and register_output.rc == 0)

0 comments on commit 2df6da4

Please sign in to comment.