From 2e818302736038777c7293e837d621e507b6154a Mon Sep 17 00:00:00 2001 From: jloh Date: Thu, 22 Dec 2016 21:39:16 +1100 Subject: [PATCH] Move custom commands to Ansible modules --- tasks/install.yml | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/tasks/install.yml b/tasks/install.yml index bfa5b67..56a131b 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -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 @@ -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