Checkpoint some refactoring
This commit is contained in:
parent
b0070af1fd
commit
70543ef7c5
3 changed files with 50 additions and 27 deletions
19
tryme.scm
19
tryme.scm
|
@ -1,9 +1,28 @@
|
|||
(use-modules
|
||||
(ice-9 filesystem)
|
||||
(logging logger)
|
||||
(srfi srfi-26)
|
||||
(ordo)
|
||||
(ordo connection)
|
||||
(ordo logger))
|
||||
|
||||
(define* (install-aws-cli conn #:key (url "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip") update? install-dir bin-dir)
|
||||
(let ((tmp-dir (run conn "mktemp" "-d" #:return car #:check? #t)))
|
||||
(dynamic-wind
|
||||
(const #t)
|
||||
(lambda ()
|
||||
(let ((zipfile (file-name-join* tmp-dir (file-basename url))))
|
||||
(run conn "wget" "-O" zipfile url #:check? #t)
|
||||
(run conn "unzip" zipfile "-d" tmp-dir #:check? #t)
|
||||
(run conn (file-name-join* tmp-dir "aws" "install")
|
||||
(when install-dir `("-i" ,install-dir))
|
||||
(when bin-dir `("-b" ,bin-dir))
|
||||
(when update? "-u")
|
||||
#:check? #t)))
|
||||
(lambda ()
|
||||
(for-each (cut log-msg 'INFO <>)
|
||||
(run conn "echo" "rm" "-rf" tmp-dir #:check? #t))))))
|
||||
|
||||
(define test-playbook
|
||||
(playbook
|
||||
#:name "Test Playbook"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue