Skip to content

Commit

Permalink
Move custom commands to Ansible modules
Browse files Browse the repository at this point in the history
  • Loading branch information
jloh committed Dec 22, 2016
1 parent 34c29eb commit 2e81830
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,16 @@
changed_when: false

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

# Download the CSF file
# @TODO: [WARNING]: Consider using get_url or uri module rather than running wget
- name: download csf files
command: "wget https://download.configserver.com/csf.tgz"
args:
chdir: /tmp/csf
when: result|failed

# Extract tar.gz
# @TODO: [WARNING]: Consider using unarchive module rather than running tar
- name: extract csf files
command: tar -zxf csf.tgz
args:
chdir: /tmp/csf
unarchive: >
src=https://download.configserver.com/csf.tgz dest=/tmp/csf
remote_src=yes
when: result|failed

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

# Cleanup TEMP dir we created
- name: cleanup csf files
command: rm -rf /tmp/csf
file: >
path=/tmp/csf state=absent
when: result|failed

0 comments on commit 2e81830

Please sign in to comment.