Using salt to provision and I want to be able to run cmd.script. The script works if i list all packages i intend to install within the script. But i will prefer to have the list of packages in salt formula and refer to it from the script.
Below works ok.
salt-formula
Run masterscript:
cmd.script:
- name: masterscript
- source: http://server/r-install.sh
r-install.sh
IFS=","
packages="'devtools','shiny','rmarkdown','plyr','shinydashboard','googleVis','RPostgreSQL','reshape2','xtable','DT','lattice','latticeExtra','ggplot2','formattable','plotly','htmlwidgets','shinyBS','stringr','DBI'"
for i in $packages; do su - -c "R -e \"install.packages($i, repos='http://cran.rstudio.com')\""; done
I will prefer to list the packages in pillar ie:
r:
packages:
- package1
- package2
Best Answer
salt-formula:
r-install.sh: