From b02a8c40c76cb2e61c7a664ec156407101201a24 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 25 Jan 2023 14:40:44 +0100 Subject: move tool existence conditionals to role common --- roles/vagrant/tasks/main.yml | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'roles/vagrant/tasks') diff --git a/roles/vagrant/tasks/main.yml b/roles/vagrant/tasks/main.yml index 31bfe11..53a64c2 100644 --- a/roles/vagrant/tasks/main.yml +++ b/roles/vagrant/tasks/main.yml @@ -1,17 +1,9 @@ -- name: Check if vagrant is installed - command: vagrant --version - register: vagrant_version - changed_when: false - failed_when: false +- name: Update plugins + command: vagrant plugin update -- when: vagrant_version.rc == 0 - block: - - name: Update plugins - command: vagrant plugin update +- name: Prune invalid entries + command: vagrant global-status --prune + become: true - - name: Prune invalid entries - command: vagrant global-status --prune - become: true - - - name: Clean up boxes - command: vagrant box prune --force --keep-active-boxes +- name: Clean up boxes + command: vagrant box prune --force --keep-active-boxes -- cgit v1.2.3