나는 스스로를 가르치고 있으며 두 개의 간단한 파일이 있습니다. 디지털 바다 서버에 R 및 일부 패키지를 설치하고 싶습니다.쉘을 통해 r 패키지를 설치할 때 오류가 발생할 수 있습니다.
호스트[droplets]
<IP ADRESS>
playbook.yml
- hosts: droplets
user: root
sudo: true
vars:
- foo: Hello There Ansible
tasks:
- name: install R
apt: name=r-base state=installed
- name: install plyr
shell: echo "install.packages('plyr', repos=c('http://www.freestatistics.org/cran/'))" | R --no-save
나는 내가 command
옵션 대신 shell
명령을 사용하지 않도록 this question에서 이해했다.
이 오류가 계속 발생합니다.
$ ansible-playbook -i hosts -k playbook.yml
SSH password:
ERROR: Syntax Error while loading YAML script, playbook.yml
Note: The error may actually appear before this position: line 10, column 1
- name: install plyr
shell: echo "install.packages('plyr', repos=c('http://www.freestatistics.org/cran/'))" | R --no-save
^
그러나 컴퓨터에 ssh를 설치하면 정확한 명령이 제대로 작동하는 것 같습니다.
[email protected]<IP ADRESS>:~# echo "install.packages('plyr', repos=c('http://www.freestatistics.org/cran/'))" | R --no-save
R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> install.packages('plyr', repos=c('http://www.freestatistics.org/cran/'))
Installing package(s) into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning: dependency ‘Rcpp’ is not available
trying URL 'http://www.freestatistics.org/cran/src/contrib/plyr_1.8.1.tar.gz'
Content type 'application/x-gzip' length 393233 bytes (384 Kb)
opened URL
==================================================
downloaded 384 Kb
내 플레이 북에 무엇이 잘못 되었나요?
어떤 버전을 실행합니까? 게임 북은 잘 작동합니다. – leucos