Skip to content

Commit

Permalink
Install vagrant plugins only for gitlab-runner user
Browse files Browse the repository at this point in the history
  • Loading branch information
ruzickap committed Mar 3, 2019
1 parent 71ed87b commit 791949e
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions ansible/build_remote_ssh_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
- https://www.virtualbox.org/download/oracle_vbox_2016.asc
- https://www.virtualbox.org/download/oracle_vbox.asc

- name:
- name: Add Virtualbox repository
apt_repository:
repo: deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian {{ ansible_distribution_release }} contrib

Expand Down Expand Up @@ -151,15 +151,20 @@

become: true

- name: List installed Vagrant Plugins
command: vagrant plugin list
register: vagrant_plugin_list
changed_when: false
- block:
- name: List installed Vagrant Plugins
command: vagrant plugin list
register: vagrant_plugin_list
changed_when: false

- name: Install Vagrant Plugins
command: vagrant plugin install {{ item }}
loop: "{{ vagrant_plugins }}"
when: vagrant_plugin_list.stdout is not search(item)

become: yes
become_user: gitlab-runner

- name: Install Vagrant Plugins
command: vagrant plugin install {{ item }}
loop: "{{ vagrant_plugins }}"
when: vagrant_plugin_list.stdout is not search(item)

handlers:
- name: reboot
Expand Down

0 comments on commit 791949e

Please sign in to comment.