diff --git a/ansible/base.yml b/ansible/base.yml index 93bc7a096305a74b25e4a7a479eea42fcf404e0d..3183b3191d31dec0c3b761696fd9cc563894a227 100644 --- a/ansible/base.yml +++ b/ansible/base.yml @@ -3,4 +3,5 @@ hosts: default become: true roles: + - { name: 'fix_centos_repo', tags: 'fix_centos_repo' } - { name: 'install_packages', tags: 'install_packages' } diff --git a/ansible/compute.yml b/ansible/compute.yml index 198454852c2e28cc47ea8661a45fce7fae6f44fb..2907d08077a8431a717209aec22fc362bf2391a7 100644 --- a/ansible/compute.yml +++ b/ansible/compute.yml @@ -3,6 +3,7 @@ hosts: default become: true roles: + - { name: 'fix_centos_repo', tags: 'fix_centos_repo' } - { name: 'install_packages', tags: 'install_packages' } - { name: 'pam_slurm_adopt', tags: 'pam_slurm_adopt' } - { name: 'install_nhc', tags: 'install_nhc'} diff --git a/ansible/gpu.yml b/ansible/gpu.yml index b6ec44d471b8e7fb15e333fef66ce5210620b7c3..a2db140173109afb6e7eab64199c09884a0c176a 100644 --- a/ansible/gpu.yml +++ b/ansible/gpu.yml @@ -3,6 +3,7 @@ hosts: default become: true roles: + - { name: 'fix_centos_repo', tags: 'fix_centos_repo' } - { name: 'install_packages', tags: 'install_packages' } - { name: 'cuda_driver', tags: 'cuda_driver' } - { name: 'pam_slurm_adopt', tags: 'pam_slurm_adopt' } diff --git a/ansible/ood.yml b/ansible/ood.yml index a92436b43dcc21560a894b3c4cc939359f1323bb..089ffd3ee0d3cece4cc03c3a2a8a047083fa2b6d 100644 --- a/ansible/ood.yml +++ b/ansible/ood.yml @@ -3,6 +3,7 @@ hosts: default become: true roles: + - { name: 'fix_centos_repo', tags: 'fix_centos_repo' } - { name: 'install_packages', tags: 'install_packages' } - { name: 'install_zsh', tags: 'install_zsh' } diff --git a/ansible/roles/fix_centos_repo/tasks/main.yaml b/ansible/roles/fix_centos_repo/tasks/main.yaml new file mode 100644 index 0000000000000000000000000000000000000000..983a86d29ceb2ae74917be3bad856c15554f6e78 --- /dev/null +++ b/ansible/roles/fix_centos_repo/tasks/main.yaml @@ -0,0 +1,20 @@ +--- +- name: Get CentOS repo files + shell: ls /etc/yum.repos.d/CentOS-* + register: repo_files + +- name: Remove mirrorlist from CentOS repo files + ansible.builtin.replace: + path: "{{ item }}" + regexp: '^mirrorlist' + replace: '#mirrorlist' + backup: yes + with_items: "{{ repo_files.stdout_lines }}" + +- name: Use vault baseurl to CentOS repo files + ansible.builtin.replace: + path: "{{ item }}" + regexp: '^#baseurl=http://mirror.centos.org' + replace: 'baseurl=http://vault.centos.org' + backup: yes + with_items: "{{ repo_files.stdout_lines }}"