library/roles/octave: Role that installs octave from the Ubuntu PPA.

This commit is contained in:
Andrea Dell'Amico 2016-09-13 17:46:44 +02:00
parent 225e70a693
commit 9335dbfbe6
2 changed files with 30 additions and 0 deletions

7
octave/defaults/main.yml Normal file
View File

@ -0,0 +1,7 @@
---
octave_install: False
octave_repo: 'ppa:octave/stable'
octave_pkg_state: latest
octave_pkgs:
- octave

23
octave/tasks/main.yml Normal file
View File

@ -0,0 +1,23 @@
---
- block:
- name: Install the octave repository
apt_repository: repo={{ octave_repo }} update_cache=yes
- name: Install the octave packages
apt: pkg={{ item }} state={{ octave_pkg_state }} update_cache=yes cache_valid_time=3600
with_items: '{{ octave_pkgs }}'
tags: octave
when: octave_install
- block:
- name: Remove the octave repository
apt_repository: repo={{ octave_repo }} state=absent
- name: Remove the octave packages
apt: pkg={{ item }} state=absent
with_items: '{{ octave_pkgs }}'
tags: octave
when: not octave_install