Skip to content

Commit

Permalink
added option so apt cache update can be disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
pescobar committed Oct 22, 2021
1 parent 08bb223 commit 2f2ba40
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ slurm_group:
# EPEL is required to install slurm packages and some dependencies on CentOS/RedHat systems
slurm_add_epel_repo: true

# By default we update the apt cache on Debian/Ubuntu but you can disable it
# for faster execution after the initial setup
slurm_update_apt_cache: true

# You can set this to true to enable the openhpc yum repos on centos
# If you plan to use packages from openhpc you should also update the list of packages for RedHat below
slurm_add_openhpc_repo: false
Expand Down
15 changes: 8 additions & 7 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@
- not ansible_virtualization_type == "docker" # we cannot modify /etc/hosts in container
- not ansible_virtualization_type == "containerd" # we cannot modify /etc/hosts in container

- name: Update apt cache on Debian/Ubuntu systems
ansible.builtin.apt:
update_cache: yes
cache_valid_time: 600
when:
- ansible_os_family == 'Debian'
- slurm_update_apt_cache
changed_when: false

- name: Download slurm config from git if "slurm_config_git_repo" is defined
block:
Expand All @@ -66,13 +74,6 @@

when: slurm_config_git_repo is defined

- name: Make sure the apt cache is updated on Debian/Ubuntu systems
ansible.builtin.apt:
update_cache: yes
cache_valid_time: 600
when: ansible_os_family == 'Debian'
changed_when: false

- name: Install EPEL repository
ansible.builtin.yum:
name: epel-release
Expand Down

0 comments on commit 2f2ba40

Please sign in to comment.