Skip to content

Commit

Permalink
update old go removal
Browse files Browse the repository at this point in the history
  • Loading branch information
dchristiany committed Jul 21, 2020
1 parent bac7826 commit c272147
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 94 deletions.
79 changes: 2 additions & 77 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,80 +9,5 @@ bind_paths: []
# - /shared/home/
# - /shared/project/

#go variable
old_go_versions:
- 1.14.3
- 1.14.2
- 1.14.1
- 1.14
- 1.13.12
- 1.13.11
- 1.13.10
- 1.13.9
- 1.13.8
- 1.13.7
- 1.13.6
- 1.13.5
- 1.13.4
- 1.13.3
- 1.13.2
- 1.13.1
- 1.13
- 1.12.17
- 1.12.16
- 1.12.15
- 1.12.14
- 1.12.13
- 1.12.12
- 1.12.11
- 1.12.10
- 1.12.9
- 1.12.8
- 1.12.7
- 1.12.6
- 1.12.5
- 1.12.4
- 1.12.3
- 1.12.2
- 1.12.1
- 1.12
- 1.11.13
- 1.11.12
- 1.11.11
- 1.11.10
- 1.11.9
- 1.11.8
- 1.11.7
- 1.11.6
- 1.11.5
- 1.11.4
- 1.11.3
- 1.11.2
- 1.11.1
- 1.11
- 1.10.8
- 1.10.7
- 1.10.6
- 1.10.5
- 1.10.4
- 1.10.3
- 1.10.2
- 1.10.1
- 1.10
- 1.9.6
- 1.9.5
- 1.9.4
- 1.9.3
- 1.9.2
- 1.9.1
- 1.9
- 1.8.7
- 1.8.6
- 1.8.5
- 1.8.4
- 1.8.3
- 1.8.2
- 1.8.1
- 1.8
- 1.7.4
- 1.7.3
#go variables
only_one_go_version: true
30 changes: 13 additions & 17 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,21 @@
changed_when: False
failed_when: False

- name: singularity | remove older Go installation
- name: singularity | get older go installation(s)
find:
paths: /opt/go/
file_type: directory
use_regex: yes
patterns: ['^(?!{{ golang_version }})1.[0-9]{1,2}(.[0-9]{1,2}|)$']
register: older_go_versions
when: only_one_go_version

- name: singularity | remove older Go installation(s)
file:
path: '/opt/go/{{ item }}'
path: '{{ item.path }}'
state: absent
with_items: "{{ old_go_versions }}"

- name: singularity | install dependencies
apt:
pkg:
- build-essential
- uuid-dev
- libgpgme-dev
- squashfs-tools
- libseccomp-dev
- wget
- pkg-config
- git
- cryptsetup-bin
update_cache: yes
with_items: "{{ older_go_versions.files }}"
when: only_one_go_version

- name: singularity | install Go dependencies
command: go get -u -v github.com/golang/dep/cmd/dep
Expand Down

0 comments on commit c272147

Please sign in to comment.