diff --git a/scala-sbt/defaults/main.yml b/scala-sbt/defaults/main.yml new file mode 100644 index 00000000..414eca8a --- /dev/null +++ b/scala-sbt/defaults/main.yml @@ -0,0 +1,7 @@ +--- +scala_sbt_install: True +scala_sbt_repo_key: "2EE0EA64E40A89B84B2DF73499E82A75642AC823" +scala_sbt_repo: "deb https://dl.bintray.com/sbt/debian /" +scala_sbt_pkgs: + - sbt + diff --git a/scala-sbt/meta/main.yml b/scala-sbt/meta/main.yml new file mode 100644 index 00000000..f79bb7ea --- /dev/null +++ b/scala-sbt/meta/main.yml @@ -0,0 +1,4 @@ +--- +dependencies: + - { role: '../../library/roles/oracle-jdk', when: openjdk_install is not defined or not openjdk_install } + - { role: '../../library/roles/openjdk', when: openjdk_install | default(False) } diff --git a/scala-sbt/tasks/main.yml b/scala-sbt/tasks/main.yml new file mode 100644 index 00000000..3b2373d4 --- /dev/null +++ b/scala-sbt/tasks/main.yml @@ -0,0 +1,26 @@ +--- +- block: + - name: Install the scala sbt repository key + apt_key: keyserver='keyserver.ubuntu.com' id={{ scala_sbt_repo_key }} state=present + + - name: Install the scala sbt repository configuration + apt_repository: repo={{ scala_sbt_repo }} state=present update_cache=yes file=scala-sbt.list + + - name: Install the scala sbt packages + apt: pkg={{ scala_sbt_pkgs }} state=present update_cache=yes cache_valid_time=3600 + + when: scala_sbt_install + tags: [ 'scala', 'sbt', 'scala_sbt' ] + +- block: + - name: Remove the scala sbt packages + apt: pkg={{ scala_sbt_pkgs }} state=absent + + - name: Remove the scala sbt repository configuration + apt_repository: repo={{ scala_sbt_repo }} state=absent update_cache=yes file=scala-sbt.list + + - name: Remove the scala sbt repository key + apt_key: keyserver='keyserver.ubuntu.com' id={{ scala_sbt_repo_key }} state=absent + + when: not scala_sbt_install + tags: [ 'scala', 'sbt', 'scala_sbt' ]