diff --git a/README.md b/README.md index bdbfcbd..f241197 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,10 @@ Set up the latest version of R in Ubuntu systems. * `r_environment`: [default: `{}`]: Environment variables to set (during the install, update or delete packages tasks) +* `r_scripts_install_path:`: [default: `/usr/local/bin`]: The path where to install the R script used to install, update and delete R package +* `r_scripts_install_owner`: [default: `root`]: The owner of the R script to install, update and delete R package +* `r_scripts_install_group`: [default: `root`]: The group of the R script to install, update and delete R package + ## Dependencies None diff --git a/defaults/main.yml b/defaults/main.yml index 83d437f..ead56f6 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -14,3 +14,7 @@ r_packages_repos: "{{ r_cran_mirror }}" r_packages_lib: /usr/local/lib/R/site-library r_packages: [] r_environment: {} + +r_scripts_install_path: /usr/local/bin +r_scripts_install_owner: root +r_scripts_install_group: root diff --git a/tasks/packages.yml b/tasks/packages.yml index 6b926ba..3231073 100644 --- a/tasks/packages.yml +++ b/tasks/packages.yml @@ -2,10 +2,10 @@ --- - name: packages | copy r scripts template: - src: "usr/local/bin/{{ item.src }}" - dest: "/usr/local/bin/{{ item.dest }}" - owner: root - group: root + src: "{{ item.src }}" + dest: "{{ r_scripts_install_path }}/{{ item.dest }}" + owner: "{{ r_scripts_install_owner }}" + group: "{{ r_scripts_install_group }}" mode: 0755 with_items: - src: R-install-package.j2 @@ -23,7 +23,7 @@ - name: packages | install command: > - R-install-package + {{ r_scripts_install_path }}/R-install-package {{ item.name }} {{ item.type | default(r_packages_type) }} {{ item.lib | default(r_packages_lib) }} @@ -43,7 +43,7 @@ - name: packages | remove command: > - R-remove-package + {{ r_scripts_install_path }}/R-remove-package {{ item.name }} {% if item.lib is defined %}{{ item.lib }}{% endif %} environment: "{{ r_environment }}" @@ -58,7 +58,7 @@ - name: packages | update command: > - R-update-package + {{ r_scripts_install_path }}/R-update-package {{ item.name }} {{ item.type | default(r_packages_type) }} {{ item.lib | default(r_packages_lib) }} diff --git a/templates/usr/local/bin/R-install-package.j2 b/templates/R-install-package.j2 similarity index 100% rename from templates/usr/local/bin/R-install-package.j2 rename to templates/R-install-package.j2 diff --git a/templates/usr/local/bin/R-install-requirements.j2 b/templates/R-install-requirements.j2 similarity index 100% rename from templates/usr/local/bin/R-install-requirements.j2 rename to templates/R-install-requirements.j2 diff --git a/templates/usr/local/bin/R-remove-package.j2 b/templates/R-remove-package.j2 similarity index 100% rename from templates/usr/local/bin/R-remove-package.j2 rename to templates/R-remove-package.j2 diff --git a/templates/usr/local/bin/R-update-package.j2 b/templates/R-update-package.j2 similarity index 100% rename from templates/usr/local/bin/R-update-package.j2 rename to templates/R-update-package.j2 diff --git a/templates/usr/local/bin/R-update-packages.j2 b/templates/R-update-packages.j2 similarity index 100% rename from templates/usr/local/bin/R-update-packages.j2 rename to templates/R-update-packages.j2