Skip to content

Commit

Permalink
Add support for environment variables
Browse files Browse the repository at this point in the history
fixes #22
  • Loading branch information
tersmitten committed Jan 11, 2018
1 parent ddf378b commit 101a745
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ r_install_dev: false
r_install:
- littler

r_environment: {}

r_packages_type: cran
r_packages_repos: "{{ r_cran_mirror }}"
r_packages_lib: /usr/local/lib/R/site-library
Expand Down
3 changes: 3 additions & 0 deletions tasks/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
{{ item.type | default(r_packages_type) }}
{{ item.lib | default(r_packages_lib) }}
{% if item.repos is defined %}{{ item.repos }}{% endif %}
environment: "{{ r_environment }}"
register: _r_install_package
changed_when: "_r_install_package.stdout_lines[-1] is defined and _r_install_package.stdout_lines[-1] == 'changed'"
with_items: "{{ r_packages_from_github | ternary(r_preset_package_remotes + r_packages, r_packages) }}"
Expand All @@ -40,6 +41,7 @@
R-remove-package
{{ item.name }}
{% if item.lib is defined %}{{ item.lib }}{% endif %}
environment: "{{ r_environment }}"
register: _r_remove_package
changed_when: "_r_remove_package.stdout_lines[-1] is defined and _r_remove_package.stdout_lines[-1] == 'changed'"
with_items: "{{ r_packages }}"
Expand All @@ -52,6 +54,7 @@
R-update-package
{{ item.name }}
{% if item.lib is defined %}{{ item.lib }}{% endif %}
environment: "{{ r_environment }}"
register: _r_update_package
changed_when: "_r_update_package.stdout_lines[-1] is defined and _r_update_package.stdout_lines[-1] == 'changed'"
with_items: "{{ r_packages }}"
Expand Down

0 comments on commit 101a745

Please sign in to comment.