Use ansible ruby role to install gems 90/2190/1
authorEric Ball <eball@linuxfoundation.org>
Fri, 10 Jan 2020 01:26:23 +0000 (17:26 -0800)
committerEric Ball <eball@linuxfoundation.org>
Fri, 10 Jan 2020 01:26:23 +0000 (17:26 -0800)
We're running into issues installing gems using "gem install"
commands, due to missing/outdated ruby version. Instead, we should
use a third-party ruby role, which will install a specific version of
ruby, and as a bonus, can handle installing the specific gems we want
as well.

Issue-ID: LF-Jira IT-18593
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
Change-Id: I3fe5987f17342d0d366eeed731d4f42687e1fc73

packer/provision/local-docker.yaml

index e75a0fa..fd24d8d 100644 (file)
     - include_role: name=lfit.system-update
 
   tasks:
-    - name: 'Install rake gem'
-      command: 'gem install rake'
-      become: true
-
-    - name: 'Install PackageCloud'
-      command: 'gem install package_cloud'
-      become: true
+    - include_role:
+        name: fubarhouse.ruby
+      vars:
+        ruby_version: 2.4.0
+        ruby_packages:
+          - rake
+          - package_cloud
 
     - include_role:
         name: fubarhouse.golang