Skip to content
This repository was archived by the owner on Aug 27, 2025. It is now read-only.

Commit e9e8b46

Browse files
authored
Merge pull request #11 from jloh/remove_commands
Move custom commands to Ansible modules
2 parents 34c29eb + 2e81830 commit e9e8b46

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

tasks/install.yml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,16 @@
88
changed_when: false
99

1010
# Create a temp dir for our install
11-
# @TODO: [WARNING]: Consider using file module with state=directory rather than running mkdir
1211
- name: create temp dir
13-
command: mkdir -p /tmp/csf
12+
file: >
13+
path=/tmp/csf state=directory mode=0700
1414
when: result|failed
1515

1616
# Download the CSF file
17-
# @TODO: [WARNING]: Consider using get_url or uri module rather than running wget
1817
- name: download csf files
19-
command: "wget https://download.configserver.com/csf.tgz"
20-
args:
21-
chdir: /tmp/csf
22-
when: result|failed
23-
24-
# Extract tar.gz
25-
# @TODO: [WARNING]: Consider using unarchive module rather than running tar
26-
- name: extract csf files
27-
command: tar -zxf csf.tgz
28-
args:
29-
chdir: /tmp/csf
18+
unarchive: >
19+
src=https://download.configserver.com/csf.tgz dest=/tmp/csf
20+
remote_src=yes
3021
when: result|failed
3122

3223
# Install lib-perl which is sometimes required for retrieving HTTPS URL's
@@ -77,5 +68,6 @@
7768

7869
# Cleanup TEMP dir we created
7970
- name: cleanup csf files
80-
command: rm -rf /tmp/csf
71+
file: >
72+
path=/tmp/csf state=absent
8173
when: result|failed

0 commit comments

Comments
 (0)