Skip to content

Commit d7e5d81

Browse files
author
P4T12ICK
committed
fixes
1 parent 03934c3 commit d7e5d81

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

tasks/install_art.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
register: art_atomics_installed
88
changed_when: false
99

10-
- name: Check if Atomic Red Team module is already installed
10+
- name: Check if Atomic Red Team module directory exists
1111
become: true
12-
shell: pwsh -Command 'if (Get-Module -ListAvailable -Name invoke-atomicredteam) { exit 0 } else { exit 1 }'
13-
register: art_module_check
12+
stat:
13+
path: /root/AtomicRedTeam/Invoke-AtomicRedTeam
14+
register: art_module_installed
1415
changed_when: false
15-
failed_when: false
1616

1717
- name: Install Atomic Red Team
1818
become: true
@@ -22,8 +22,8 @@
2222
IEX (IWR https://raw.githubusercontent.com/redcanaryco/invoke-atomicredteam/master/install-atomicredteam.ps1);
2323
Install-AtomicRedTeam -Force'
2424
register: output_art
25-
when: (not art_atomics_installed.stat.exists | default(false)) or (art_module_check.rc != 0)
26-
changed_when: "'already installed' not in (output_art.stdout | default('') + output_art.stderr | default('')) and 'already exists' not in (output_art.stdout | default('') + output_art.stderr | default(''))"
25+
when: (not art_atomics_installed.stat.exists | default(false)) or (not art_module_installed.stat.exists | default(false))
26+
changed_when: (not art_atomics_installed.stat.exists | default(false)) or (not art_module_installed.stat.exists | default(false))
2727

2828
- name: create directory for default powershell profile
2929
file:

0 commit comments

Comments
 (0)